Add vera test contract-driven testing (#79)#168
Merged
Merged
Conversation
New `vera test` command generates inputs from requires() clauses via Z3 and executes compiled WASM to validate ensures() at runtime. Functions are classified by tier: Tier 1 (proved by Z3) reported as "verified", Tier 3 (runtime-checked) exercised with generated inputs, and generic/unsupported functions skipped. Features: - Z3-based input generation for Int, Nat, Bool parameters - Boundary value seeding before diversity loop - --json, --trials N, --fn name flags - E7xx error code range (E700-E702) - 24 new tests (1,100 total) Co-Authored-By: Claude <noreply@anthropic.invalid>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vera testcommand: generates inputs fromrequires()clauses via Z3, executes compiled WASM, validatesensures()at runtime--json,--trials N,--fn nameflagsvera/tester.pymodule (~530 lines) with publictest()APITest plan
pytest tests/ -v-- 1,100 tests passmypy vera/-- clean (41 source files)python scripts/check_examples.py-- 14 examples passpython scripts/check_version_sync.py-- version consistentpython scripts/check_readme_examples.py-- README blocks parsevera test examples/safe_divide.vera-- smoke test worksvera test --json examples/factorial.vera-- JSON output worksCloses #79
Generated with Claude Code