Skip to content
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

Regression testing #30

Merged
merged 3 commits into from
Aug 20, 2024
Merged

Regression testing #30

merged 3 commits into from
Aug 20, 2024

Conversation

aazuspan
Copy link
Owner

Closes #28 by adding regression testing for the parser's output state with the example patches, via pytest-regressions.

Currently, I test:

  1. The serialized list of tokens from evaluated_tokens
  2. semantic_encoding
  3. diagnostics

This excludes the intermediate and internal attributes like _parsed_tokens or symtbl, since those should all be reflected in the evaluated_tokens.

This does not exhaustively test the tokens, since their properties (like hover data) aren't evaluated. That should all be well-covered by existing tests, but might be worth adding in the future.

Generating the encoding once should speed up semantic token
requests since they can be cached with the parser, and it
will also make it easier to regression test.

Parsing on init prevents having an "unparsed" parser, which
would complicate accessing things like evaluated tokens and
semantic encoding.
@aazuspan aazuspan self-assigned this Aug 20, 2024
@aazuspan aazuspan merged commit c8f137f into main Aug 20, 2024
6 checks passed
@aazuspan aazuspan deleted the regression-testing branch August 20, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression testing the parser
1 participant