blob: 05a8c59ce18d33d283924e74cd7212df6404178b (
plain)
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
|
(fate_version 1)
(global string test_name)
(set! test_name ( COUNT ))
(assert! (= (list:count 10 (list:range 0 60 1)) 1)
[FAILED] (var test_name) Failed to find 10 in list:range 0 60 1.
)
(global (list int) li)
(list:add_all! (list:range 0 10 1) li)
(list:add_all! (list:range 0 10 1) li)
(list:add_all! (list:range 0 10 1) li)
(list:add_all! (list:range 0 10 1) li)
(assert! (= (list:count 10 li) 4)
[FAILED] (var test_name) Failed to find 10 four times in li.
)
(global (set int) si)
(list:add_all! (list:range 0 10 1) si)
(list:add_all! (list:range 0 10 1) si)
(list:add_all! (list:range 0 10 1) si)
(list:add_all! (list:range 0 10 1) si)
(assert! (= (set:count 10 si) 1)
[FAILED] (var test_name) Failed to find 10 exactly once in si.
)
(global (list string) ls)
(list:add! test0 ls)
(list:add! test1 ls)
(list:add! test2 ls)
(list:add! test3 ls)
(assert! (= (list:count test0 ls) 1)
[FAILED] (var test_name) Failed to find test0 exactly once in ls.
)
(list:add! test0 ls)
(list:add! test1 ls)
(list:add! test2 ls)
(list:add! test3 ls)
(list:add! test0 ls)
(list:add! test1 ls)
(list:add! test2 ls)
(list:add! test3 ls)
(list:add! test0 ls)
(list:add! test1 ls)
(list:add! test2 ls)
(list:add! test3 ls)
(assert! (= (list:count test0 ls) 4)
[FAILED] (var test_name) Failed to find test0 four times in ls.
)
(global (list bool) lb)
(local int i)
(for (set! i 0) (=< i 10) (set! i (+ i 1))
(list:add! (= (mod i 2) 0) lb)
)
(assert! (= (list:count (true) lb) 6)
[FAILED] (var test_name) Failed to find six even numbers.
)
(assert! (= (list:count (false) lb) 5)
[FAILED] (var test_name) Failed to find four odd numbers.
)
[COMPLETED] (var test_name)
(end!)
|