Skip to content
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

Improve negative test cases for JSON generation #693

Merged

Conversation

riedgar-ms
Copy link
Collaborator

Switch the remaining negative test cases to the improved pattern devised by @hudson-ai . This looks for particular failure bytes in the input, rather than depending on the vagaries of models.Mock() behaviour.

@riedgar-ms
Copy link
Collaborator Author

riedgar-ms commented Mar 14, 2024

And please, please squash this on merge. The intermediate commits have at best zero value.

@hudson-ai
Copy link
Collaborator

Looks good, thanks @riedgar-ms! I think that this is a lot more intuitive than the negative tests using Mock :)

Do you think that adding an explicit grammar.match to the positive cases (in addition to checking successful generation by Mock) would add any comfort/value?

@riedgar-ms
Copy link
Collaborator Author

Probably wouldn't hurt @hudson-ai . Actually, that should likely be most of the testing, since you want the test as 'close to the code' as possible. Still having some models.Mock() test cases is useful, to check more of the stack.

@Harsha-Nori
Copy link
Collaborator

LGTM

@Harsha-Nori Harsha-Nori merged commit d398d5f into guidance-ai:main Mar 14, 2024
15 checks passed
@riedgar-ms riedgar-ms deleted the riedgar-ms/convert-json-tests01 branch March 15, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants