-
Notifications
You must be signed in to change notification settings - Fork 805
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
Baseline parser tests #14721
Baseline parser tests #14721
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nojaf This is really cool!
Maybe we could move the files into subfolders, mimicking the file structure that was there before:
tests/service/data/SyntaxTree/Type/...
tests/service/data/SyntaxTree/Expression/...
tests/service/data/SyntaxTree/ModuleOrNamespace/...
We'll likely add a lot of these files, so maybe we could have some organization strategy from the start.
Otherwise, we could have this kind of structure in the file names, but I think it'll be much more difficult to maintain when there're many contributors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great, thanks!
__SOURCE_DIRECTORY__ usage.
@auduchinok I took a shortcut for |
[<TestCaseSource(nameof allTestCases)>] | ||
let ParseFile fileName = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an easy way to run/debug a specific test? It's going to be crucial when debugging some cases in the parser (e.g. debugging helped me a lot when I worked on the parser in #13352).
It would also be very handy to be able to dump tokens for a specific tests easily: it may really help when changing LexFilter, as in #13089.
@nojaf @vzarytovskii Would it be easy to have separate named tests, similar to what we have here? https://github.com/JetBrains/resharper-fsharp/blob/net231/ReSharper.FSharp/test/src/FSharp.Tests/Parsing/FSharpParserTest.fs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, I'm a bit late 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit 1e65a08.
* Add parser baseline tests. * Remove ported tests. * Update FSharp.Compiler.UnitTests.fsproj * Add a newline before and after the file content. * Move original tests into designated folder. * Add ending newline to baseline files. * Take __SOURCE_DIRECTORY__ result into account. * Sanitize AST for current __SOURCE_DIRECTORY__ usage.
This is a first attempt at tackling #13484.
I migrated the existing parser tests (which asserted patterns in the AST) with baseline tests.
These tests will be more interesting to detect regressions early on.