-
Notifications
You must be signed in to change notification settings - Fork 18
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
Testing #16
Milestone
Comments
harpocrates
added a commit
that referenced
this issue
Apr 13, 2017
This commit adds some testing of 'Span' (at least on the handful of core types for which we are also testing parsing). The testing procedure is: 1. parse the initial values 2. go through all of its subfields recursively 3. for each one, use the parsed span to extract a substring ffrom the initial input 4. re-parse that substring and make sure it matches While doing this, I found and fixed a bunch of small edge cases. There are probably a couple tiny ones still lurking about (and one with a TODO), but I now feel comfortable saying this fixes #14 and addresses some points in #16.
harpocrates
added a commit
that referenced
this issue
Apr 14, 2017
Adds in place the machinery for parsing the JSON output of `rustc -Z ast-json` and diff-ing it against our AST. This gets implemented as a seperate test suite. This is laying the groundwork for #16.
harpocrates
added a commit
that referenced
this issue
Apr 15, 2017
The 'rustc-tests' now are fully integrated with the 'test-framework' library, so the testing output should be nice-looking and helpful for debugging failing tests. No actual work was done in the comparision though. Continues work on #16.
harpocrates
added a commit
that referenced
this issue
Apr 19, 2017
Completed difference tests for 'Pat', 'Ty', 'Expr', most of 'Stmt', 'Lit' (and other more minor trees). Getting very close to #16.
harpocrates
added a commit
that referenced
this issue
Apr 20, 2017
Can almost diff 'ast.rs' - macros and view paths are still wonky. Also revamped tests to be type-class based. The instances for 'NonEmpty', '[]', and 'Maybe' are particularly helpful. Progress made towards #16.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here are some approaches to testing correctness of parsing and pretty printing
-Z
option for outputting a JSON of the AST, parse that JSON into our AST and diff them against the AST we get from regular parsing.The text was updated successfully, but these errors were encountered: