-
Notifications
You must be signed in to change notification settings - Fork 0
Add rigorous AST item count validation to Haskell LLBC tests #49
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
base: hs-ast
Are you sure you want to change the base?
Conversation
- Add test_test_crate_llbc test that validates exact counts of LLBC items - Update createLlbcTest to include FunDecls count in output - Regenerate test_crate.llbc with current charon version - Add assertions for FunDecls, GlobalDecls, TypeDecls, TraitDecls, and TraitImpls Co-authored-by: ssyram <23273765+ssyram@users.noreply.github.com>
|
@copilot Test to confirm that all tests passed. If not, find the source of the inconsistency and try to fix. |
All tests passed successfully. The test suite includes 6 tests:
The new test validates exact counts of all LLBC item types (FunDecls: 2, GlobalDecls: 1, TypeDecls: 0, TraitDecls: 0, TraitImpls: 0) using assertEqual assertions. |
|
@copilot No no no, I mean in the original parsing test, add a new criterion that it should additionally test that the decl numbers are the same. So please remove your new test suite and supplement the test. |
- Removed separate test_test_crate_llbc test - Added count validation directly in createLlbcTest for test_crate.llbc - Updated getAllLlbcTests to include test/data directory - For test_crate.llbc, validates exact counts with assertEqual - For other LLBC files, displays counts in success message Co-authored-by: ssyram <23273765+ssyram@users.noreply.github.com>
Done! I've removed the separate test and integrated the count validation into the existing |
The Haskell AST tests were only verifying successful deserialization without validating the parsed structure's correctness. This adds explicit assertions on the count of each LLBC item type.
Changes
createLlbcTest: The existing LLBC parsing test now validates exact counts for test_crate.llbc and displays counts for other LLBC files. Added missing FunDecls count to diagnostic output.getAllLlbcTests: Now searches both test/data/ and ../charon/tests/ui directories for LLBC filesFor test_crate.llbc specifically, the test now validates exact counts:
Tests now fail with clear diffs when AST structure doesn't match expectations, rather than silently passing on incomplete parses. For other LLBC files, counts are displayed in the success message.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.