wuz/tests/test_array.wuz

30 lines
786 B
Plaintext
Raw Permalink Normal View History

2023-08-24 15:22:49 +00:00
assert [1, 2, 3] == [1, 2, 3]
assert ["a", "b", "c"] == ["a", "b", "c"]
assert [1, 2, 3] != [7, 2, 3]
assert [1, 2, 3] != [1, 2, 3, 4]
assert ["a", "b", "c"] != ["ac", "b", "c"]
assert ["a", "b", "c"] != ["a", "b", "c", "d"]
assert 3 == [3, 8, 9][0]
assert 8 == [3, 8, 9][1]
assert 9 == [3, 8, 9][2]
assert "8" == ["3", "8", "9"][2 - 1]
assert 7 == [[4, 6], [9, 2, 7], [3, 3, 2]][1, 2]
assert 9 == [[4, 6], [9, 2, 7], [3, 3, 2]][[2, 9, 1][2], 0]
2023-08-24 17:30:31 +00:00
assert [1, 2] == [1] + [2]
assert [3, 4, 5, 6] == [3] + [4] + [5, 6]
assert [[2, 4], [6, 8]] == [[2, 4]] + [[6, 8]]
2023-08-24 09:55:54 +00:00
2023-08-24 17:52:33 +00:00
assert [0, 1, 0, 1, 0, 1, 2] == [0, 1] * 3 + [2]
assert [0, 1, 0, 1, 0, 1] == 3 * [0, 1]
assert [0, 0, 0, 0, 0, 0, 1] == 2 * (3 * [0]) + [1]
2023-08-25 16:22:44 +00:00
assert [2, 4] == [[2, 4], [7, 9]][0]
assert [7, 9] == [[2, 4], [7, 9]][1]