test: migrate examples to XXXX-category-name layout + split expected streams

Rename all example tests/companions to the XXXX-category-test-name scheme
(per-category 100-blocks: basic 0010, types 0100, ... errors 1000,
diagnostics 1100, ffi 1200, ffi-objc 1300, ffi-jni 1400, vectors 1500,
platform 1600). Companions and dir/C fixtures move in lockstep with their
parent test; #import/#source/#include paths rewritten to match.

Expected output now lives in examples/expected/ (a sibling dir of the
tests) split into three streams per the new convention:
  <name>.exit / <name>.stdout / <name>.stderr  (+ optional <name>.ir)

run_examples.sh rewritten: scans examples/ and issues/ for an
expected/<name>.exit marker, captures stdout and stderr separately (no
more 2>&1), compares each stream + exit + optional IR snapshot.

Behavior validated unchanged: every renamed test reproduces its prior
merged output + exit (diffs limited to file paths/basenames embedded in
diagnostics + traces, which correctly reflect the new names). Suite:
292 passed, 0 failed. 50-smoke.sx split + issue relocation + docs follow
in subsequent commits.
This commit is contained in:
agra
2026-06-01 19:05:15 +03:00
parent e86e41b719
commit 4e942b5373
1231 changed files with 480 additions and 822 deletions

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
Hello

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
scope opened
scoped x: 6
scope closed
main x: 42

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
still here

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
hello from the other side

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
[1.000000, 0.000000, -1.000000]

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
count: 5
break at: 12
sum of odd 1-9: 25
sum 55

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
containedcontainedcontained

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
[1, 2, 2, 2, 3, 3, 4, 5, 5, 6, 6, 333]

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,41 @@
--- tagged enum compat ---
T1: 3.140000
T2: 3
T3: 5.000000 3.000000
T4: 2.710000
T5: 9.500000
T6: 4.199999
T7a: 1.000000
T7b: 2.000000 3.000000
T7c: 3
T8a: 10
T8b: 20
T8c: 30
T9: 42
T10a: 1
T10b: 1.000000
T10c: 9.000000
--- struct static shorthand ---
S1: 3.000000 4.000000
S2: 5.000000 6.000000
S3: 7.000000 8.000000
S4: 0.000000 0.000000
S4: 1.000000 0.000000
S5: 60
S6: 8.000000 8.000000 8.000000 8.000000
S6: 8.000000 16.000000 8.000000 16.000000
S6: 0.000000 12.000000 0.000000 12.000000
S7: 7
S8: 3.000000 4.000000
S8q: 1.000000 2.000000
S9: 4.000000 6.000000
S10: 4.000000 6.000000
--- edge cases ---
E1: 5.000000 1.000000 2.000000
E2: 9 1.000000 2.000000
E3: 1
E4: 4.000000 6.000000
E5: 42
E6: 1
E7: 20.000000 10.000000
=== DONE ===

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,5 @@
double: 14
sum: 7
answer: 42
total: 30
scaled: 90

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,10 @@
i=0
i=1
i=2
n=5
j=2
j=3
j=4
[0]=A
[1]=B
[2]=A

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,3 @@
101 102 103
circle 2.000000
none

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
sum 60
sum2 360
via ptr 360
boxes 7

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,6 @@
v1: Vec4{x: 1.000000, y: 2.000000, z: 3.000000, w: 0.000000}
v2: Vec4{x: 4.000000, y: 1.000000, z: 1.000000, w: 3.000000}
v3: Vec4{x: 2.000000, y: 3.000000, z: 4.000000, w: 0.000000}
v4: Vec4{x: 9.000000, y: 0.000000, z: 5.000000, w: 6.000000}
Complex{foo: .B(Complex.foo.B{val: hello})}

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
a 0 : Foo{a: 0, b: 42, c: 0, d: 17}
a 1 : Foo{a: 1, b: 42, c: 8, d: 17}
b: Foo{a: 1, b: 0, c: 101, d: 0}
Pack{a: 1, b: 0, c: 3, d: 5, f: 9, v: 100, x: 3.500000}

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,8 @@
circle: .circle(3.140000)
radius: 3.140000
none: .none
rect: .rect(Shape.rect{w: 4.000000, h: 2.000000})
sh: .circle(2.710000)
rect val: Shape.rect{w: 2.000000, h: 4.000000}
matched rect
case : 2

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,7 @@
p: Point{x: 10, y: 20}
c: Color{r: 255, g: 128, b: 0}
n: 42
s: hello
b: true
&p: *Point@0xADDR
&p: *Point@0xADDR

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,6 @@
f=3.140000
i=1078523331
x=1.000000
y=2.000000
data[0]=1.000000
data[1]=2.000000

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,26 @@
perms: .read | .write
checking: .read | .write
- can read
- can write
all: .read | .write | .execute
checking: .read | .write | .execute
- can read
- can write
- can execute
read only: .read
checking: .read
- can read
match on flags:
execute
window: .vsync | .resizable
raw value: 68
color: .blue
raw: 2
0xFF & 0x0F = 15
1 | 2 | 4 = 7

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,10 @@
add: 13
sub: 5
mul: 60
div: 5
mod: 1
and: 15
or: 255
xor: 240
shl: 64
shr: 8

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,2 @@
ok
result = 1.000000

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
size_of BigNode = 40
before: sentinel = 3735928559
after: sentinel = 3735928559
OK

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,10 @@
--- Test 1: += (broken) ---
Expected: 1, 2, 3
counter=1
counter=2
counter=3
--- Test 2: = x + 1 (works) ---
Expected: 2, 3, 4
counter=4
counter=5
counter=6

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,2 @@
VALS: -2 -1 42 99
PASS

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,6 @@
local running=true x=42 name=default
g_empty running=true x=42 name=default
g_partial running=true x=99 name=default
g_override running=false x=42 name=default
g_reorder running=false x=7 name=hi
g_positional running=false x=13 name=pos

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,3 @@
count = 42
pi = 3.140000
flag = true

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,10 @@
--- void / 0 args ---
__invoke :: (block_self: *Block) -> void callconv(.c) { typed_fn : (*void) -> void = xx block_self.sx_fn; typed_fn(block_self.sx_env); } return .{ isa = @_NSConcreteStackBlock, flags = 0, reserved = 0, invoke = xx @__invoke, descriptor = xx @__sx_block_descriptor, sx_env = self.env, sx_fn = self.fn_ptr, };
--- void / bool ---
__invoke :: (block_self: *Block, arg0: bool) -> void callconv(.c) { typed_fn : (*void, bool) -> void = xx block_self.sx_fn; typed_fn(block_self.sx_env, arg0); } return .{ isa = @_NSConcreteStackBlock, flags = 0, reserved = 0, invoke = xx @__invoke, descriptor = xx @__sx_block_descriptor, sx_env = self.env, sx_fn = self.fn_ptr, };
--- void / s64, string ---
__invoke :: (block_self: *Block, arg0: s64, arg1: string) -> void callconv(.c) { typed_fn : (*void, s64, string) -> void = xx block_self.sx_fn; typed_fn(block_self.sx_env, arg0, arg1); } return .{ isa = @_NSConcreteStackBlock, flags = 0, reserved = 0, invoke = xx @__invoke, descriptor = xx @__sx_block_descriptor, sx_env = self.env, sx_fn = self.fn_ptr, };
--- s32 / f64 ---
__invoke :: (block_self: *Block, arg0: f64) -> s32 callconv(.c) { typed_fn : (*void, f64) -> s32 = xx block_self.sx_fn; return typed_fn(block_self.sx_env, arg0); } return .{ isa = @_NSConcreteStackBlock, flags = 0, reserved = 0, invoke = xx @__invoke, descriptor = xx @__sx_block_descriptor, sx_env = self.env, sx_fn = self.fn_ptr, };
--- build done ---
rt

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,10 @@
size_of(*u8) = 8
align_of(*u8) = 8
size_of(?u8) = 2
size_of([3]u8) = 3
size_of((s32)->s32) = 8
size_of((s32, s32)) = 8
size_of(Ptr) = 8
size_of(Maybe) = 2
size_of(Arr) = 3
size_of(Cb) = 8

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,7 @@
direct s32: 4
alias s32: 4
chain s32: 4
align alias: 4
align chain: 4
size struct-alias: 16
align struct-alias:8

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
got: <hello>

View File

@@ -0,0 +1 @@
0

Some files were not shown because too many files have changed in this diff Show More