-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.rej
67 lines (57 loc) · 1.2 KB
/
tests.rej
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Arithmetic
(1 + 1) == 2
(1 + 1 + 2) == 4
(1 * 1 / 1) == 1
(1 * 1^2! / 5) == 2/5
((1 + 1 + 1)!/6^1) == 1
({1} * {1} * 1) == {1}
({1} + {1}!) == {2}
({1} ^ 1) == {1}
({1, 2, 3} ^ 2) == {1, 4, 9}
# Comparator
(true == true) == true
(true != false) == true
(0 >= 0) == true
((1 + 1) > 1) == true
(2 < 1) == false
(2 <= 1) == false
(1 == 4/4) == true
([] == []) == true
([1, 2, 3] == [1, 2, 3]) == true
([[1, 2, 3], 4] == [[1, 2, 3], 4]) == true
([[1, 2, 3], 4] == [[1, 2, 3]]) == true
({} == {}) == true
({1, 2, 3} == {1, 2, 3}) == true
({{1, 2, 3}, 4} == {{1, 2, 3}, 4}) == true
({{1, 2, 3}, 4} != {{1, 2, 3}}) == true
("" == "") == true
("hey" == "hey") == true
("日本語" != "中国語") == true
('a' == 'a') == true
('日' != '中') == true
# Ternary
(true ? true : false) == true
(true ? "1" : "0") == "1"
(true ? "1" : 0) == "1"
(true ? 1 : "0") == 1
(true == true) ? (5 * 5) : 0 == 25
# Variable assignment
x = 3
x = 5, y = 5
x = 5 * 4 % 4^3
x = 4 * 3/5, y = (6 * 23) / 4
# Logical
(true and true) == true
(not(true) or true) == true
(not(not(true))) == true
((true and true) or false) == true
# Anonymous functions
x = :(x): |x|
y = :(f): print(f)
x *= 1
x *= (y + 3) / 6
x /= |-6|
x += 34^2
x -= 4
x ^= 2
x %= 2