Skip to content

Commit f43cf89

Browse files
aallanClaude
andcommitted
fix: stale site assets, TESTING.md counts, and pipe arg-order test
- Regenerate docs/ site assets (conformance count 64→65) - Fix remaining TESTING.md stale references: 315→325 parametrized tests, two more 64→65 conformance counts in script table and pre-commit table - Add test_pipe_module_call_arg_order_regression to lock down that the pipe LHS is prepended as first arg (not appended) - Update test_checker.py count 496→497, line count 5495→5519 - Update total test count 3103→3104 Co-Authored-By: Claude <noreply@anthropic.invalid>
1 parent ae85a53 commit f43cf89

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

TESTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the single source of truth for Vera's testing infrastructure, coverage d
66

77
| Metric | Value |
88
|--------|-------|
9-
| **Tests** | 3,103 across 26 files (~34,000 lines of test code) |
9+
| **Tests** | 3,104 across 26 files (~34,000 lines of test code) |
1010
| **Compiler code coverage** | 96% of 15,149 statements (CI minimum: 80%) |
1111
| **Conformance programs** | 65 programs across 9 spec chapters, validating every language feature |
1212
| **Example programs** | 30, all validated through `vera check` + `vera verify` |
@@ -53,7 +53,7 @@ python scripts/fix_allowlists.py --fix # auto-fix stale allowlists
5353
|------|------:|------:|----------------|
5454
| `test_parser.py` | 124 | 968 | Grammar rules, operator precedence, parse errors |
5555
| `test_ast.py` | 123 | 1,130 | AST transformation, node structure, serialisation, string escape sequences, ability declarations |
56-
| `test_checker.py` | 496 | 5,495 | Type synthesis, slot resolution, effects, effect subtyping, contracts, exhaustiveness, cross-module typing, visibility, error codes, string built-ins, generic rejection, IO operation types, Markdown types, Regex types, abilities, Map collection, Set collection, Decimal type, Json type, Html type, Http effect, Inference effect, removed legacy name regression |
56+
| `test_checker.py` | 497 | 5,519 | Type synthesis, slot resolution, effects, effect subtyping, contracts, exhaustiveness, cross-module typing, visibility, error codes, string built-ins, generic rejection, IO operation types, Markdown types, Regex types, abilities, Map collection, Set collection, Decimal type, Json type, Html type, Http effect, Inference effect, removed legacy name regression |
5757
| `test_verifier.py` | 121 | 1,700 | Z3 verification, counterexamples, tier classification, call-site preconditions, branch-aware preconditions, pipe operator, cross-module contracts, match/ADT verification, decreases verification, mutual recursion |
5858
| `test_codegen.py` | 838 | 10,019 | WASM compilation, arithmetic, Float64, Byte, arrays (incl. compound element types), ADTs, match (incl. nested patterns), generics, State\<T\>, Exn\<E\> handlers, control flow, strings, string escape sequences, IO (read\_line, read\_file, write\_file, args, exit, get\_env), bounds checking, quantifiers, assert/assume, refinement type aliases, pipe operator, string built-ins, built-in shadowing, parse\_nat Result, GC, Markdown host bindings, Regex host bindings, Map collection, Set collection, Decimal type, Json type, Html type, Http effect, Inference effect, example round-trips |
5959
| `test_codegen_contracts.py` | 32 | 576 | Runtime pre/postconditions, contract fail messages, old/new state postconditions |
@@ -151,7 +151,7 @@ The manifest is the machine-readable feature inventory — agents can query it t
151151
### Running the conformance suite
152152

153153
```bash
154-
# Via pytest (parametrized — 315 tests)
154+
# Via pytest (parametrized — 325 tests)
155155
pytest tests/test_conformance.py -v
156156

157157
# Via standalone script (used in CI and pre-commit)
@@ -316,8 +316,8 @@ Twelve scripts in `scripts/` validate cross-cutting concerns beyond unit tests:
316316

317317
| Script | What it validates |
318318
|--------|-------------------|
319-
| `check_conformance.py` | All 64 conformance programs pass their declared level (parse/check/verify/run) |
320-
| `check_examples.py` | All 29 `.vera` examples pass `vera check` + `vera verify` |
319+
| `check_conformance.py` | All 65 conformance programs pass their declared level (parse/check/verify/run) |
320+
| `check_examples.py` | All 30 `.vera` examples pass `vera check` + `vera verify` |
321321
| `check_spec_examples.py` | 148 parseable code blocks from spec chapters: parse, type-check, and verify |
322322
| `check_readme_examples.py` | All Vera code blocks in README.md parse correctly |
323323
| `check_skill_examples.py` | All Vera code blocks in SKILL.md parse correctly |
@@ -358,7 +358,7 @@ After running `pre-commit install`, every commit is checked by 22 hooks:
358358
| `mypy vera/` | Type-check compiler in strict mode |
359359
| `pytest tests/ -q` | Run full test suite |
360360
| `fix_allowlists.py --fix` | Auto-fix stale allowlist line numbers |
361-
| `check_conformance.py` | All 64 conformance programs pass their declared level |
361+
| `check_conformance.py` | All 65 conformance programs pass their declared level |
362362
| `check_examples.py` | All 30 examples pass `vera check` + `vera verify` |
363363
| `check_readme_examples.py` | README code blocks parse correctly |
364364
| `check_examples_doc.py` | EXAMPLES.md code blocks parse correctly |

docs/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ Current version: 0.0.101. The reference compiler is written in Python. Install w
5050
- [TESTING.md](https://raw.githubusercontent.com/aallan/vera/main/TESTING.md): Test suite architecture, coverage data, and test conventions.
5151
- [KNOWN_ISSUES.md](https://raw.githubusercontent.com/aallan/vera/main/KNOWN_ISSUES.md): Known bugs and limitations.
5252
- [CONTRIBUTING.md](https://raw.githubusercontent.com/aallan/vera/main/CONTRIBUTING.md): Contribution guidelines.
53-
- [Conformance Suite](https://github.com/aallan/vera/tree/main/tests/conformance): 64 programs validating every language feature against the spec.
53+
- [Conformance Suite](https://github.com/aallan/vera/tree/main/tests/conformance): 65 programs validating every language feature against the spec.

tests/test_checker.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,6 +3327,30 @@ def test_pipe_chained_module_calls_typechecks(self) -> None:
33273327
private fn f(@Int -> @Int)
33283328
requires(true) ensures(true) effects(pure)
33293329
{ @Int.0 |> math::abs() |> math::abs() }
3330+
"""
3331+
prog = parse_to_ast(source)
3332+
diags = typecheck(prog, source=source, resolved_modules=[mod])
3333+
errors = [d for d in diags if d.severity == "error"]
3334+
assert errors == [], [e.description for e in errors]
3335+
3336+
def test_pipe_module_call_arg_order_regression(self) -> None:
3337+
"""LHS is prepended as first arg, not appended. (#326)
3338+
3339+
@Int.0 |> math::max(123) must desugar to math::max(value, 123),
3340+
not math::max(123, value). If the LHS were appended, the type-checker
3341+
would still accept it (both args are Int), so we verify via the
3342+
contract: ensures(@Int.result >= @Int.0) requires value >= 0 — max(v, 123)
3343+
satisfies that only when v is the first argument.
3344+
3345+
Since the checker operates on types not values, we rely on arity: using
3346+
an asymmetric two-arg function ensures any arg-count mismatch surfaces.
3347+
"""
3348+
mod = self._resolved(("math",), self.MATH_MODULE)
3349+
source = """\
3350+
import math(max);
3351+
private fn f(@Int -> @Int)
3352+
requires(true) ensures(true) effects(pure)
3353+
{ @Int.0 |> math::max(123) }
33303354
"""
33313355
prog = parse_to_ast(source)
33323356
diags = typecheck(prog, source=source, resolved_modules=[mod])

0 commit comments

Comments
 (0)