test: group examples into per-category folders
Move examples/*.sx and their expected/ snapshots into per-category subfolders (examples/<category>/...). Folder = leading filename token, with ffi-objc/ffi-jni kept whole; filenames are unchanged. The corpus runner and LSP sweep now discover each category's expected/ dir, while issues/ stays flat. Example 1058's repo-root-relative companion import is made file-relative. Path strings embedded in 164 snapshots were regenerated (path-only changes). Test-layout docs in CLAUDE.md updated.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
0
|
||||
16255
examples/protocols/expected/0400-protocols-impl-for-builtin.ir
Normal file
16255
examples/protocols/expected/0400-protocols-impl-for-builtin.ir
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
lerp(0, 10, 0.5) = 5.000000
|
||||
lerp(0, 10, 0.25) = 2.500000
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
inside add: 42
|
||||
inside add: 99
|
||||
items[0] = 42 (expected 42)
|
||||
items[1] = 99 (expected 99)
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
=== Created in main ===
|
||||
first: 42 (expected 42)
|
||||
second: 42 (expected 42)
|
||||
=== Created in add() ===
|
||||
first: 99 (expected 99)
|
||||
second: 99 (expected 99)
|
||||
=== OK ===
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== Direct 1 ===
|
||||
r1 = 42
|
||||
=== Direct 2 ===
|
||||
r2 = 42
|
||||
=== From function ===
|
||||
dispatch_fn: about to dispatch
|
||||
dispatch_fn: result = 42
|
||||
=== OK ===
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
StackA: draw=42
|
||||
StackB: draw=25
|
||||
OK
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
direct a=0 b=1
|
||||
proto f = 1
|
||||
proto f = 0
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
got pointer: true
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ok
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
g initially null
|
||||
after assign: g.ping() = 42
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
direct: null? false
|
||||
protocol: null? false
|
||||
alloc_count: 2
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: no visible xx conversion from 'i64' to 'Wrap' — impl exists in another module but is not imported
|
||||
--> examples/protocols/./0410-protocols-impl-visibility-user.sx:7:17
|
||||
|
|
||||
7 | w : Wrap = xx 7;
|
||||
| ^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: duplicate xx conversion from 'i64' to 'Wrap': impls in examples/protocols/./0411-protocols-impl-duplicate-impl-a.sx and examples/protocols/./0411-protocols-impl-duplicate-impl-b.sx
|
||||
--> examples/protocols/0411-protocols-impl-duplicate.sx:23:17
|
||||
|
|
||||
23 | w : Wrap = xx 7;
|
||||
| ^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,9 @@
|
||||
error: duplicate impl 'Into' for source 'i64' in examples/protocols/0412-protocols-impl-duplicate-same-file.sx
|
||||
--> examples/protocols/0412-protocols-impl-duplicate-same-file.sx:15:1
|
||||
|
|
||||
15 | impl Into(MyA) for i64 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
16 | convert :: (self: i64) -> MyA { .{ v = self * 2 } }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
17 | }
|
||||
| ^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
a.get=42
|
||||
b.get=hi
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
99
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
27
examples/protocols/expected/0415-protocols-protocols.stdout
Normal file
27
examples/protocols/expected/0415-protocols-protocols.stdout
Normal file
@@ -0,0 +1,27 @@
|
||||
=== Protocols ===
|
||||
P1.1: 3
|
||||
P1.2: 30
|
||||
P2.1: 42
|
||||
P2.2: 150
|
||||
P2.3: 5 10
|
||||
P3.1: 5
|
||||
P3.2: 12
|
||||
hi hi
|
||||
P4.1: 2
|
||||
yo yo
|
||||
P4.2: 2
|
||||
P4.3: 6 2
|
||||
P5.1: true false
|
||||
P5.2: 10 20
|
||||
P5.5: true false
|
||||
P5.3: true false
|
||||
P6.1: true false
|
||||
P6.2: true false
|
||||
P6.3: true false
|
||||
P6.4: 40
|
||||
P6.5: 20
|
||||
P7.1: 30
|
||||
P7.2: 10 300
|
||||
P2.6: 5 10
|
||||
P2.7: 15
|
||||
P3.3: 102
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
18933
examples/protocols/expected/0416-protocols-auto-type-erasure.ir
Normal file
18933
examples/protocols/expected/0416-protocols-auto-type-erasure.ir
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
=== Auto Type Erasure ===
|
||||
AE1: 12
|
||||
AE2: 8
|
||||
AE3: 102
|
||||
AE4: 51
|
||||
AE5: 15
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
escape!
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
measure=5x10
|
||||
scaled=15x30
|
||||
name=widget
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
tag=7 dep=9
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: 'dealloc_bytes' expects 1 argument, but 2 were given
|
||||
--> examples/protocols/1634-protocol-call-arity.sx:10:5
|
||||
|
|
||||
10 | a.dealloc_bytes(p, 12345);
|
||||
| ^^^^^^^^^^^^^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user