langcc icon indicating copy to clipboard operation
langcc copied to clipboard

Add quickcheck tests for printer and parser

Open flip111 opened this issue 3 years ago • 1 comments

Would be nice to automatically generate some tests with a quickcheck implementation such as https://github.com/emil-e/rapidcheck

One could generate some AST, print it, parse the source code and check if the AST still matches

flip111 avatar Sep 23 '22 18:09 flip111

I don't want to pull in yet another dependency, but for what it's worth, the lang unit tests already do the inverse of this for many inline examples: i.e., they test that PrettyPrint(Parse(str)) == str.

jzimmerman avatar Sep 23 '22 18:09 jzimmerman