Debian Codegraph @

lang/interpret_test/TestAstFunc2/contains0.txtar

raw
1 -- main.mcl --
2 $ints = [13, 42, 0, -37,]
3
4 $s1 = if contains(42, $ints) {
5 "passed1"
6 } else {
7 "failed"
8 }
9
10 $s2 = if contains(99, $ints) {
11 "failed"
12 } else {
13 "passed2"
14 }
15
16 $intlists = [
17 [13, 99,],
18 [42, 13,],
19 [0,],
20 [-37,],
21 ]
22
23 $s3 = if contains([42, 13,], $intlists) {
24 "passed3"
25 } else {
26 "failed"
27 }
28
29 $s4 = if contains([42, 13, 0,], $intlists) {
30 "failed"
31 } else {
32 "passed4"
33 }
34
35 test "${s1}" {} # passed
36 test "${s2}" {} # passed
37 test "${s3}" {} # passed
38 test "${s4}" {} # passed
39 -- OUTPUT --
40 Vertex: test[passed1]
41 Vertex: test[passed2]
42 Vertex: test[passed3]
43 Vertex: test[passed4]