chappertron / lammps-analyser

A linter for the LAMMPS scripting language
GNU General Public License v2.0
0 stars 0 forks source link

Have a way to write AST into S-Expressions for easier testing #10

Open chappertron opened 2 months ago

chappertron commented 2 months ago

Testing the AST is quite tricky, especially after changes to the syntax.

Adding a way to write as s-exp or maybe even rust-analyzer's RAST syntax will make testing easier, because (providing writing out is correct) we can assert that the syntax trees are the same without having to write the full complicated type tree.

chappertron commented 1 day ago

While helpful, this may require writing a whole new testing harness.

Instead, it would probably be better to use the insta crate, which will test against debug output.

Could also be used for integration tests of the CLI output.