-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ua
More file actions
121 lines (105 loc) · 4.88 KB
/
test.ua
File metadata and controls
121 lines (105 loc) · 4.88 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
~ "./lib.ua" ~ It
┌─╴test
# It~Equal tests
⍤It~Throws!(⍤ It~Equals 3 2)
⍤It~Throws!(⍤ It~Equals @3 @4)
⍤It~Throws!(⍤ It~Equals "2 2" "2 3")
⍤It~Throws!(⍤ It~Equals "2 2" "2 2 ")
⍤It~Throws!(⍤ It~Equals " 2 2" "2 2 ")
⍤It~Throws!(⍤ It~Equals [1 2] [2 2])
⍤It~Throws!(⍤ It~Equals [2 2 2] [2 2])
⍤It~Throws!(⍤ It~Equals [[2 2 3]] [[2 2 2]])
⍤It~Throws!(⍤ It~Equals [[2 2 3] [2 2 2]] [[2 2 2] [2 2 2]])
⍤It~Throws!(⍤ It~Equals {} {1})
⍤It~Throws!(⍤ It~Equals {2} {1})
⍤It~Throws!(⍤ It~Equals {[1] "hello"} {[1] "hello!"})
⍤It~Throws!(⍤ It~Equals 3.333333333333333 3.333333333333334)
⍤It~NotThrows!(⍤It~Equals 2 2)
⍤It~NotThrows!(⍤ It~Equals @2 @2)
⍤It~NotThrows!(⍤ It~Equals "2 2" "2 2")
⍤It~NotThrows!(⍤ It~Equals [2 2] [2 2])
⍤It~NotThrows!(⍤ It~Equals [[2 2 2]] [[2 2 2]])
⍤It~NotThrows!(⍤ It~Equals [[2 2 2] [2 2 2]] [[2 2 2] [2 2 2]])
⍤It~NotThrows!(⍤ It~Equals {} {})
⍤It~NotThrows!(⍤ It~Equals {1} {1})
⍤It~NotThrows!(⍤ It~Equals {[1] "hello"} {[1] "hello"})
⍤It~NotThrows!(⍤ It~Equals 3.3333333333333333 3.3333333333333333)
⍤It~NotThrows!(⍤ It~Equals 3.3333333333333333501823918203 3.33333333333333333928309182038) # This is to show the limitations in It~Equals
# It~NotEquals tests
⍤It~NotThrows!(⍤ It~NotEquals 3 2)
⍤It~NotThrows!(⍤ It~NotEquals @3 @4)
⍤It~NotThrows!(⍤ It~NotEquals "2 2" "2 3")
⍤It~NotThrows!(⍤ It~NotEquals "2 2" "2 2 ")
⍤It~NotThrows!(⍤ It~NotEquals " 2 2" "2 2 ")
⍤It~NotThrows!(⍤ It~NotEquals [1 2] [2 2])
⍤It~NotThrows!(⍤ It~NotEquals [2 2 2] [2 2])
⍤It~NotThrows!(⍤ It~NotEquals [[2 2 3]] [[2 2 2]])
⍤It~NotThrows!(⍤ It~NotEquals [[2 2 3] [2 2 2]] [[2 2 2] [2 2 2]])
⍤It~NotThrows!(⍤ It~NotEquals {} {1})
⍤It~NotThrows!(⍤ It~NotEquals {2} {1})
⍤It~NotThrows!(⍤ It~NotEquals {[1] "hello"} {[1] "hello!"})
⍤It~NotThrows!(⍤ It~NotEquals 3.333333333333333 3.333333333333334)
⍤It~Throws!(⍤(It~NotEquals 2 2))
⍤It~Throws!(⍤ It~NotEquals @2 @2)
⍤It~Throws!(⍤ It~NotEquals "2 2" "2 2")
⍤It~Throws!(⍤ It~NotEquals [2 2] [2 2])
⍤It~Throws!(⍤ It~NotEquals [[2 2 2]] [[2 2 2]])
⍤It~Throws!(⍤ It~NotEquals [[2 2 2] [2 2 2]] [[2 2 2] [2 2 2]])
⍤It~Throws!(⍤ It~NotEquals {} {})
⍤It~Throws!(⍤ It~NotEquals {1} {1})
⍤It~Throws!(⍤ It~NotEquals {[1] "hello"} {[1] "hello"})
⍤It~Throws!(⍤ It~NotEquals 3.3333333333333333 3.3333333333333333)
⍤It~Throws!(⍤ It~NotEquals 3.3333333333333333501823918203 3.33333333333333333928309182038) # This is to show the limitations in It~Equals
# It~HasSameRank tests
⍤It~NotThrows!(⍤It~HasSameRank 2 2)
⍤It~Throws!(⍤It~HasSameRank 2 [2])
⍤It~Throws!(⍤It~NotHasSameRank 2 2)
⍤It~NotThrows!(⍤It~NotHasSameRank 2 [2])
# It~HasSameShape tests
⍤It~NotThrows!(⍤It~HasSameShape 2 2)
⍤It~Throws!(⍤It~HasSameShape [2] [2 3])
⍤It~Throws!(⍤It~NotHasSameShape 2 2)
⍤It~NotThrows!(⍤It~NotHasSameShape [2] [2 3])
# It~Contains tests
⍤It~NotThrows!(
⍤It~Contains 2 [
[[1 3 3 3]
[1 2 3 4] # Searches deep into the array
[1 1 1 1]
]
]
)
⍤It~NotThrows!(⍤It~Contains 2 [1 2 3])
⍤It~NotThrows!(⍤It~Contains @u "uiua")
⍤It~NotThrows!(⍤It~Contains "ui" "uiua")
⍤It~NotThrows!(⍤It~Contains {{1}} {{1} [2] 3})
⍤It~Throws!(⍤It~Contains 2 [1 1 3])
⍤It~Throws!(⍤It~Contains @q "uiua")
⍤It~Throws!(⍤It~Contains "au" "uiua")
⍤It~Throws!(⍤It~Contains {{9}} {{1} [2] 3})
⍤It~Throws!(⍤It~NotContains 2 [1 2 3])
⍤It~Throws!(⍤It~NotContains @u "uiua")
⍤It~Throws!(⍤It~NotContains "ui" "uiua")
⍤It~Throws!(⍤It~NotContains {{1}} {{1} [2] 3})
⍤It~NotThrows!(⍤It~NotContains 2 [1 1 3])
⍤It~NotThrows!(⍤It~NotContains @q "uiua")
⍤It~NotThrows!(⍤It~NotContains "au" "uiua")
⍤It~NotThrows!(⍤It~NotContains {{9}} {{1} [2] 3})
⍤It~Throws!(⍤It~IsGreaterThan 2 3)
⍤It~Throws!(⍤It~IsGreaterThan 3 3)
⍤It~NotThrows!(⍤It~IsGreaterThan 4 3)
⍤It~Throws!(⍤It~IsGreaterThan [2 2] [3 3])
⍤It~Throws!(⍤It~IsGreaterThan 6 [3 3])
⍤It~NotThrows!(⍤It~IsGreaterThan 4 [1 1 1])
⍤It~NotThrows!(⍤It~IsLessThan 2 3)
⍤It~Throws!(⍤It~IsLessThan 3 3)
⍤It~Throws!(⍤It~IsLessThan 4 3)
⍤It~Throws!(⍤It~IsGreaterThanOrEqualTo 2 3)
⍤It~NotThrows!(⍤It~IsGreaterThanOrEqualTo 3 3)
⍤It~Throws!(⍤It~IsLessThanOrEqualTo 4 3)
⍤It~NotThrows!(⍤It~IsLessThanOrEqualTo 3 3)
⍤It~Equals "failed asserting `2` is equal to `1`" ◌:It~Equals 1 2
⍤It~Equals "failed asserting `[2 3 1]` contains the value `1`" ◌:It~Contains 1 [2 3 1]
⍤It~Equals "failed asserting `[2 3 1]` does NOT contain the value `5`" ◌:It~NotContains 5 [2 3 1]
⍤It~Equals "failed asserting `[5]` has the same rank as `5`" ◌:It~HasSameRank 5 [5]
└─╴