Debian Codegraph @

lang/interpret_test/TestAstFunc2/structlookup1.txtar

raw
1 -- main.mcl --
2 $st0 = struct{x1 => 1.0, x5 => 2.1, x15 => 3.2,}
3 $s0a = if $st0->x1 == 1.0 {
4 "passed0a"
5 } else {
6 "failed"
7 }
8 test "${s0a}" {}
9 $s0b = if $st0->x5 == 2.1 {
10 "passed0b"
11 } else {
12 "failed"
13 }
14 test "${s0b}" {}
15 $s0c = if $st0->x15 == 3.2 {
16 "passed0c"
17 } else {
18 "failed"
19 }
20 test "${s0c}" {}
21
22 $st1 struct{x1 float; x5 float; x15 float} = struct{x1 => 1.0, x5 => 2.1, x15 => 3.2,}
23 $s1 = if $st1->x5 == 2.1 {
24 "passed1"
25 } else {
26 "failed"
27 }
28 test "${s1}" {}
29
30 $st2 = struct{x1 => 1.0, x5 => 2.1, x15 => 3.2,}
31 $s2 = if $st2->x5 == 2.1 {
32 "passed2"
33 } else {
34 "failed"
35 }
36 test "${s2}" {}
37 -- OUTPUT --
38 Vertex: test[passed0a]
39 Vertex: test[passed0b]
40 Vertex: test[passed0c]
41 Vertex: test[passed1]
42 Vertex: test[passed2]