wuz/tests/test_vars.wuz

36 lines
461 B
Plaintext
Raw Normal View History

2023-08-25 11:41:42 +00:00
let a = 4
let b = 7
let c = a * b + 1
assert 29 == c
2023-08-25 16:22:44 +00:00
let d = [[2, 4], [6, 8]]
assert 6 == d[1, 0]
assert [2, 4] == d[0]
assert [6, 8] == d[1]
let e = 0
let f = 1
assert [2, 4] == d[e]
assert [6, 8] == d[f]
2023-08-25 16:38:06 +00:00
let! g = 4
2023-08-26 04:53:14 +00:00
let! h = 7
let i = 3
2023-08-25 16:38:06 +00:00
2023-08-26 04:53:14 +00:00
h = h + i
assert 10 == h
let! j = [1, 2, 3]
j[0] = 12
j[1] = j[0] + 1
assert [12, 13, 3] == j
let! k = [[2, 4], [6, 8]]
k[1, 0] = 12
assert [[2, 4], [12, 8]] == k
k[1] = k[1] + [3]
assert [[2, 4], [12, 8, 3]] == k