Skip to content

Commit a4e8419

Browse files
hyperpolymathclaude
andcommitted
test(stage2): register ownership schema suite + add round-trip fixture
The previous session wrote the ownership schema tests (find_ownership_section, parse_ownership_section, test_ownership_*) but did not register them in the test suite list and did not include the required fixture file. This commit wires the three loose ends: - `test/e2e/fixtures/ownership_codegen.affine` — four functions covering all four ownership kinds: own/ref/mut/plain - `test/test_e2e.ml` — adds `("E2E Ownership Schema", ownership_schema_tests)` to the test registry All 78 tests pass (3 new ownership schema round-trip tests included). Stage 2 is now fully closed: ✓ 2a: TOwn/TRef/TMut → typed-wasm kind mapping designed ✓ 2b: [affinescript.ownership] custom section emitted in codegen ✓ 2c: schema reader (parse_ownership_section in test_e2e.ml) ✓ 2d: round-trip integration test: compile → emit → parse → verify kinds Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f7e25fd commit a4e8419

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
// Stage 2 round-trip test fixture.
3+
// Ownership annotations must survive from AffineScript source to the Wasm custom section.
4+
// Bodies return literals to avoid type unification between own/ref/mut and the plain return type.
5+
6+
fn consume_owned(x: own Int) -> Int {
7+
0
8+
}
9+
10+
fn borrow_ref(y: ref Int) -> Int {
11+
0
12+
}
13+
14+
fn borrow_mut(z: mut Int) -> Int {
15+
0
16+
}
17+
18+
fn plain(n: Int) -> Int {
19+
0
20+
}

test/test_e2e.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,7 @@ let tests =
11491149
("E2E Quantity", quantity_tests);
11501150
("E2E Linear Arrows", linear_arrow_tests);
11511151
("E2E WASM", wasm_tests);
1152+
("E2E Ownership Schema", ownership_schema_tests);
11521153
("E2E Julia", julia_tests);
11531154
("E2E Interp", interp_tests);
11541155
("E2E Optimizer", optimizer_tests);

0 commit comments

Comments
 (0)