smoke tests

This commit is contained in:
agra
2026-02-15 19:44:20 +02:00
parent a3be9cce7c
commit 7da3ecfa7c
9 changed files with 1046 additions and 149 deletions

View File

@@ -3,4 +3,4 @@ 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: .S(Complex.foo.B{val: hello})}
Complex{foo: .B(Complex.foo.B{val: hello})}

View File

@@ -8,7 +8,7 @@ v2[1]: 3.000000
scaled: [2.000000, 6.000000, 4.000000]
neg: [-1.000000, -3.000000, -2.000000]
sqrt(9): 3.000000
.counter(0.500000)
.user(0.500000)
4
16
8

View File

@@ -1,7 +1,7 @@
circle: .circle(3.140000)
radius: 3.140000
none: .circle
rect: .circle(Shape.rect{w: 4.000000, h: 2.000000})
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

View File

@@ -0,0 +1 @@
0

148
tests/expected/50-smoke.txt Normal file
View File

@@ -0,0 +1,148 @@
=== 1. Literals ===
decimal: 42
hex: 255
binary: 10
float: 3.140000
f64: 2.718281
true: true
false: false
escapes: hello world
multiline: line1
line2
heredoc: raw heredoc
undef-then-set: 77
enum-lit: .green
=== 2. Operators ===
add: 7
sub: 7
mul: 42
div: 5
mod: 2
neg: -5
eq: true
neq: true
lt: true
gt: true
le: true
ge: true
chain: true
chain-gt: true
chain-mixed: true
band: 15
bor: 7
and: true
and-false: false
or: true
or-false: false
ca+=: 15
ca-=: 12
ca*=: 24
ca/=: 4
prec1: 14
prec2: 20
xx-cast: 200
=== 3. Types ===
s8: 127
s16: 32000
s32: 100000
u8: 255
u16: 65000
u32: 4000000
alias: 1.500000
struct-pos: Point{x: 1, y: 2}
struct-prefix: Point{x: 3, y: 4}
struct-named: Point{x: 20, y: 10}
struct-shorthand: Point{x: 5, y: 6}
defaults: a=0 b=99
field-assign: Point{x: 42, y: 99}
enum: .red
backing: .err
tagged: .circle(3.140000)
payload: 3.140000
void-variant: .none
match: rect
match-expr: 10
capture: 9.500000
else-match: other
bool: true
union-f: 3.140000
union-i: 1078523331
promoted-x: 1.000000
promoted-data0: 1.000000
arr[2]: 30
arr.len: 5
sl[0]: 1
sl.len: 5
sub: [20, 30, 40]
head: [10, 20, 30]
tail: [30, 40, 50]
strsub: world
deref: Point{x: 10, y: 20}
auto-deref: 10
mp[0]: 10
mp[3]: 40
=== 4. Control Flow ===
ite: 1
if-block: yes
if-block-expr: 15
while: 5
while-break: 7
while-continue: 25
for: 10 20 30 40
for-print: 10 20 30 40
for-idx: 0 1 2 3
for-2arg: 10@0 20@1 30@2 40@3
for-break: 10 20
for-continue: 10 30 40
=== 5. Functions ===
const: 42
typed-const: 3.140000
default-init: 0
implicit-ret: 42
early-ret: 5
early-ret2: 99
void-return: ok
generic-s32: 42
generic-f32: 1.500000
generic-multi: 30
lambda: 14
lambda-ret: 5.000000
varargs: 15
spread: 60
fp: 7
fp-reassign: 12
fp-apply: 30
=== 6. Scoping ===
inner: 200
outer: 100
nest3: 3
nest2: 2
nest1: 1
defer-a
defer-b
defer-c
inner-defer
outer-defer
=== 7. Builtins ===
write-ok
sqrt: 3.000000
sizeof-s32: 4
sizeof-f64: 8
typeof: int
typename: Point
fieldcount: 2
fieldname0: x
fieldname1: y
fieldval0: 11
fieldval1: 22
fieldidx: 1
cast: 3
=== 8. Comptime ===
run-const: 25
insert-ok
=== 9. Flags ===
flags: .read | .write
has-read: yes
flags-raw: 3
=== DONE ===