-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tests for Serde #137
Conversation
Thanks! Hmm. I am not sure whether I want tests that only look for a |
Not complex, very verbose and unreadable tests. I can add asserts for all the properties not only for the type if you are ok with the approach. But by directly testing JSON, most of the content of the fixture is spans (which I think redundant to check for serde). For example
vs
|
If you remove positional info and indentation it becomes fine? |
Do you mean like below? But positions are not optional in the parsed mdast even though we can make them optional in serde using
|
What I was thinking of is:
Or, isn’t it
You can also choose to dig into a node of course: we often don’t care about
|
I mean we have to come up with the implementation of that |
I believe that the comparison is possible after using a utility function? This is the JavaScript version: https://github.com/syntax-tree/unist-util-remove-position. Walking trees is a bit different in Rust, but the approach should be similar? |
Yes
I will try to implement visit on Node. Though, It's just 'query the result JSON' versus 'modify the result(visit) to match'. |
Closing this one as there two many changes. |
This is follow up for PR #135
Without jaq tests are becoming verbose and unwieldy.
I hope adding a test dependency is fine with you.