-
Notifications
You must be signed in to change notification settings - Fork 10
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
Simple constant folding optimization as an example #332
Conversation
Looks good! I like that we're moving away from egglog programs as strings.
Another common test pattern, which desugars to
|
I considered separating these two, but we should almost always be calling both. This way, you won't forget to. |
I think tests will come out cleaner and be more readable if they are separate. If it's good style to test both, this should happen during review. Also note that it's odd we expect all test programs to have the same expected value - turning the param from a vector of programs to a single program (or: vector of program-output pairs) will encourage more diverse testing. |
Here's a "test both" alternative that doesn't do two separate things:
It can first interpret and check the i/o pairs on both pgrm and expected. If there's a discrepancy, there's an issue in the test or the interpreter! Then, if pgrm is not rewritten to expected, we catch a bug in the optimizations. Note that it can be implemented neatly using the functions I suggested in my first comment. |
We should add that too, but a lot of our tests involve strait up egglog code (f.e. analysis tests) |
+1 |
No description provided.