-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_bool.dry
38 lines (31 loc) · 1.57 KB
/
test_bool.dry
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
def test_equality() {
assert_true("true == true should be true", true == true);
assert_false("true == false should be false", true == false);
assert_false("false == true should b e false", false == true);
assert_true("false == false", false == false);
assert_false("true == 1 should be false", true == 1);
assert_false("false == 0 should be false", false == 0);
assert_false("true == 'true' should be false", true == "true");
assert_false("false == 'false' should be false", false == "false");
assert_false("false == '' should be false", false == "");
assert_false("true != true should be false", true != true);
assert_true("true != false should be true", true != false);
assert_true("false != true should be true", false != true);
assert_false("false != false should be false", false != false);
assert_true("true != 1 should be true", true != 1);
assert_true("false != 0 should be true", false != 0);
assert_true("true != 'true' should be true", true != "true");
assert_true("false != 'false' should be true", false != "false");
assert_true("false != '' should be true", false != "");
}
def test_not() {
assert_false("!true should be false", !true);
assert_true("!false should be true", !false);
assert_true("!!true should be true", !!true);
assert_false("not true should be false", not true);
assert_true("not false should be true", not false);
assert_true("not not true should be true", not not true);
assert_true("true should not be equal to 1", not (true == 1));
}
test_equality();
test_not();