-
Notifications
You must be signed in to change notification settings - Fork 115
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
Draft: pretty-printer tests with random generated AST Expressions #1248
base: main
Are you sure you want to change the base?
Conversation
when I see something like this, I immediately think of adding shrinking (fast-check should support it)
even shrinking integer literals would already help a lot here |
I'm thinking about that right now. It might become more user- friendly values value: fc.bigInt({ min: -1_000_000_000n, max: 1_000_000_000n }) |
left: expression, | ||
right: expression, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two need to be different expressions in general
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fixed
id: fc.constant(0), | ||
loc: fc.constant(dummySrcInfo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a wrapper to automatically add these id
and loc
to the generated AST nodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All generators wrapped by dummyAstNode
now
condition: expression, | ||
thenBranch: expression, | ||
elseBranch: expression, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be 3 different expressions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, every expression is new-generated
80ca1e6
to
88786b8
Compare
Issue
Towards #642
Checklist
docs/
and made the build locallya--b
anda++b
#1247Plan