jzimmerman / langcc

langcc: A Next-Generation Compiler Compiler

Home Page:https://langcc.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add quickcheck tests for printer and parser

flip111 opened this issue · 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

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.