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

[lang-test] Use tree dumps for regression tests #2388

Merged
merged 8 commits into from
Apr 11, 2020

Conversation

oowekyala
Copy link
Member

This makes it possible to write parser tests that just compare a dump of the AST against a baseline. This can make for cheap regression tests, which can be useful

  • in language modules which use an external parser, and so the structure can easily change when upgrading the parser library (eg Javascript, Apex, Scala).
  • in newer language modules, where the amount of tests to write to get decent parser coverage is overwhelming (eg Scala)
  • to support parser features that may easily change in the future, eg Java preview features

I extracted the AST printer from the designer codebase, so that the designer can use this printer in the next update

This adds a few tests for Scala as a PoC

@oowekyala oowekyala added the in:ast About the AST structure or API, the parsing step label Mar 28, 2020
@oowekyala oowekyala added this to the 6.23.0 milestone Mar 28, 2020
@pmd-test
Copy link

pmd-test commented Mar 28, 2020

1 Message
📖 This changeset introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report
This changeset introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@adangel adangel self-requested a review April 4, 2020 08:58
Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@adangel adangel merged commit 85924b5 into pmd:master Apr 11, 2020
@oowekyala oowekyala deleted the test-ast-dump branch April 11, 2020 19:38
@oowekyala oowekyala added the in:testing About tests of pmd, eg the module pmd-lang-test or pmd-test label Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:ast About the AST structure or API, the parsing step in:testing About tests of pmd, eg the module pmd-lang-test or pmd-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants