-
Notifications
You must be signed in to change notification settings - Fork 3
Update test cases for #zm7 alternation #34
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
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Let's simplify @andy1li - notes added
internal/stage_alternation.go
Outdated
{ | ||
Pattern: "a (cat|dog)", | ||
Input: "a cow", | ||
ExpectedExitCode: 1, | ||
}, | ||
{ | ||
Pattern: "^((Buffalo|buffalo)[ ]?)+$", | ||
Input: "Buffalo buffalo buffalo Buffalo buffalo", |
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.
Still seems super arcane @andy1li - I saw the link you shared and now remember it, but what we're looking for is something that a user is going to be happy to debug and figure out. If it seems like something that isn't "obvious" or something that they might not use in the real-world this is going to be frustrating for them.
I'll give you one example to get started (don't have to use this one, just to illustrate and I'm also not sure if all features used here are covered in previous stages):
I see 1 cat, 2 dogs and 3 cows
^I see (\d (cat|dog|apple)s?(, | and )?)+
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.
Makes sense!
Yep, all features are covered. (We just cannot use sentence-ending punctuations like . or ?, because we didn't introduce escaping.)
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.
Added note
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.
Note added
…just expected exit codes
Thanks @cjon256 for the suggestion! |
Context:
It's kinda hard to come up with an negative compound test case that's interesting, so how about two positive ones?
Since it's the last main stage, hopefully it's not too crazy.