tests
This commit is contained in:
1
tests/expected/01-basic.exit
Normal file
1
tests/expected/01-basic.exit
Normal file
@@ -0,0 +1 @@
|
||||
42
|
||||
1
tests/expected/01-basic.txt
Normal file
1
tests/expected/01-basic.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
tests/expected/02-stdout.exit
Normal file
1
tests/expected/02-stdout.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/02-stdout.txt
Normal file
1
tests/expected/02-stdout.txt
Normal file
@@ -0,0 +1 @@
|
||||
Hello
|
||||
1
tests/expected/03-structs.exit
Normal file
1
tests/expected/03-structs.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
6
tests/expected/03-structs.txt
Normal file
6
tests/expected/03-structs.txt
Normal 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: .S(Complex.foo.B{val: hello})}
|
||||
1
tests/expected/04-shadow.exit
Normal file
1
tests/expected/04-shadow.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
tests/expected/04-shadow.txt
Normal file
4
tests/expected/04-shadow.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
scope opened
|
||||
scoped x: 6
|
||||
scope closed
|
||||
main x: 42
|
||||
1
tests/expected/05-run.exit
Normal file
1
tests/expected/05-run.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/expected/05-run.txt
Normal file
2
tests/expected/05-run.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
hello 25
|
||||
hello 25
|
||||
1
tests/expected/06-generic.exit
Normal file
1
tests/expected/06-generic.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
3
tests/expected/06-generic.txt
Normal file
3
tests/expected/06-generic.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
sum: 5
|
||||
sum: 42
|
||||
sum: 42.500000
|
||||
1
tests/expected/07-defer.exit
Normal file
1
tests/expected/07-defer.exit
Normal file
@@ -0,0 +1 @@
|
||||
42
|
||||
1
tests/expected/07-defer.txt
Normal file
1
tests/expected/07-defer.txt
Normal file
@@ -0,0 +1 @@
|
||||
still here
|
||||
1
tests/expected/09-import.exit
Normal file
1
tests/expected/09-import.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/expected/09-import.txt
Normal file
2
tests/expected/09-import.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
hello thereafter hello
|
||||
[1.000000, 2.000000, 3.000000]
|
||||
1
tests/expected/10-generic-struct.exit
Normal file
1
tests/expected/10-generic-struct.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
16
tests/expected/10-generic-struct.txt
Normal file
16
tests/expected/10-generic-struct.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
v1: Vec__3_f32{data: [1.000000, 3.000000, 2.000000]}
|
||||
v2: [1.000000, 3.000000, 2.000000]
|
||||
buff: [0.000000, 2.000000, 3.500000, 4.000000, 0.000000]
|
||||
comp: Complex__u32{value: 42, count: 1}
|
||||
add: [4.000000, 5.000000, 3.000000]
|
||||
v2.x: 1.000000
|
||||
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)
|
||||
4
|
||||
16
|
||||
8
|
||||
8
|
||||
8
|
||||
1
tests/expected/11-vector-math.exit
Normal file
1
tests/expected/11-vector-math.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
tests/expected/11-vector-math.txt
Normal file
4
tests/expected/11-vector-math.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
dot: 0.000000
|
||||
cross: [0.000000, 0.000000, 1.000000]
|
||||
length: 5.000000
|
||||
norm: [0.600000, 0.800000, 0.000000]
|
||||
1
tests/expected/12-meta.exit
Normal file
1
tests/expected/12-meta.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
tests/expected/12-meta.txt
Normal file
4
tests/expected/12-meta.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
f64
|
||||
3.200000
|
||||
Vec4
|
||||
() -> s32
|
||||
1
tests/expected/13-code.exit
Normal file
1
tests/expected/13-code.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/13-code.txt
Normal file
1
tests/expected/13-code.txt
Normal file
@@ -0,0 +1 @@
|
||||
hello from the other side
|
||||
1
tests/expected/14-demo.exit
Normal file
1
tests/expected/14-demo.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/14-demo.txt
Normal file
1
tests/expected/14-demo.txt
Normal file
@@ -0,0 +1 @@
|
||||
[1.000000, 0.000000, -1.000000]
|
||||
1
tests/expected/15-while.exit
Normal file
1
tests/expected/15-while.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
tests/expected/15-while.txt
Normal file
4
tests/expected/15-while.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
count: 5
|
||||
break at: 12
|
||||
sum of odd 1-9: 25
|
||||
sum 55
|
||||
1
tests/expected/16-union.exit
Normal file
1
tests/expected/16-union.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
8
tests/expected/16-union.txt
Normal file
8
tests/expected/16-union.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
circle: .circle(3.140000)
|
||||
radius: 3.140000
|
||||
none: .circle
|
||||
rect: .circle(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
|
||||
1
tests/expected/17-lambda.exit
Normal file
1
tests/expected/17-lambda.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/17-lambda.txt
Normal file
1
tests/expected/17-lambda.txt
Normal file
@@ -0,0 +1 @@
|
||||
-3
|
||||
1
tests/expected/18-conditions.exit
Normal file
1
tests/expected/18-conditions.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/18-conditions.txt
Normal file
1
tests/expected/18-conditions.txt
Normal file
@@ -0,0 +1 @@
|
||||
containedcontainedcontained
|
||||
1
tests/expected/19-varargs.exit
Normal file
1
tests/expected/19-varargs.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
tests/expected/19-varargs.txt
Normal file
4
tests/expected/19-varargs.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
60
|
||||
1 2 3 4 5
|
||||
60
|
||||
10 20 30
|
||||
1
tests/expected/20-any-varargs.exit
Normal file
1
tests/expected/20-any-varargs.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
3
tests/expected/20-any-varargs.txt
Normal file
3
tests/expected/20-any-varargs.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
42 hello true 3.140000
|
||||
point: (10,20) 99
|
||||
3
|
||||
1
tests/expected/21-categories.exit
Normal file
1
tests/expected/21-categories.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
7
tests/expected/21-categories.txt
Normal file
7
tests/expected/21-categories.txt
Normal 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
|
||||
1
tests/expected/22-anytype.exit
Normal file
1
tests/expected/22-anytype.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/22-anytype.txt
Normal file
1
tests/expected/22-anytype.txt
Normal file
@@ -0,0 +1 @@
|
||||
5
|
||||
1
tests/expected/23-quicksort.exit
Normal file
1
tests/expected/23-quicksort.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/23-quicksort.txt
Normal file
1
tests/expected/23-quicksort.txt
Normal file
@@ -0,0 +1 @@
|
||||
[1, 2, 2, 2, 3, 3, 4, 5, 5, 6, 6, 333]
|
||||
1
tests/expected/24-list.exit
Normal file
1
tests/expected/24-list.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
tests/expected/24-list.txt
Normal file
1
tests/expected/24-list.txt
Normal file
@@ -0,0 +1 @@
|
||||
List__s32{items: [*]s32@0xADDR, len: 5, cap: 8}
|
||||
1
tests/expected/25-slices.exit
Normal file
1
tests/expected/25-slices.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
9
tests/expected/25-slices.txt
Normal file
9
tests/expected/25-slices.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
arr.len = 5
|
||||
arr[1..4] = [1, 4, 1]
|
||||
sub.len = 3
|
||||
arr[..3] = [3, 1, 4]
|
||||
arr[2..] = [4, 1, 5]
|
||||
sl[1..4] = [20, 30, 40]
|
||||
mid[1..] = [30, 40]
|
||||
msg[6..11] = world
|
||||
msg[..5] = hello
|
||||
1
tests/expected/26-pointers.exit
Normal file
1
tests/expected/26-pointers.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
5
tests/expected/26-pointers.txt
Normal file
5
tests/expected/26-pointers.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
before: Vec2{x: 1.000000, y: 2.000000}
|
||||
after: Vec2{x: 99.000000, y: 2.000000}
|
||||
copy: Vec2{x: 99.000000, y: 2.000000}
|
||||
mp[0] = 10
|
||||
mp[2] = 30
|
||||
1
tests/expected/29-fn-pointers.exit
Normal file
1
tests/expected/29-fn-pointers.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
tests/expected/29-fn-pointers.txt
Normal file
4
tests/expected/29-fn-pointers.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
fp(3,4) = 7
|
||||
fp(3,4) = 12
|
||||
apply(add,5,6) = 11
|
||||
apply(mul,5,6) = 30
|
||||
1
tests/expected/30-union.exit
Normal file
1
tests/expected/30-union.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
6
tests/expected/30-union.txt
Normal file
6
tests/expected/30-union.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
f=3.140000
|
||||
i=1078523331
|
||||
x=1.000000
|
||||
y=2.000000
|
||||
data[0]=1.000000
|
||||
data[1]=2.000000
|
||||
1
tests/expected/31-flags.exit
Normal file
1
tests/expected/31-flags.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
26
tests/expected/31-flags.txt
Normal file
26
tests/expected/31-flags.txt
Normal 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
|
||||
Reference in New Issue
Block a user