forked from Timilehin/Yoruba-Intonator
-
Notifications
You must be signed in to change notification settings - Fork 2
/
counter_tests.py
141 lines (128 loc) · 3.13 KB
/
counter_tests.py
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
from counter import Counter
c = Counter(2, [2,3,])
assert c.get_curr_value() == "00"
assert c.can_increment()
c.increment()
assert c.get_curr_value() == "01"
assert c.can_increment()
c.increment()
assert c.get_curr_value() == "02"
assert c.can_increment()
c.increment()
assert c.get_curr_value() == "10"
assert c.can_increment()
c.increment()
assert c.get_curr_value() == "11"
assert c.can_increment()
c.increment()
assert c.get_curr_value() == "12"
assert not c.can_increment()
d = Counter(3, [6,1,6])
assert d.get_curr_value() == "000"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "001"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "002"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "003"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "004"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "005"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "100"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "101"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "102"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "103"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "104"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "105"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "200"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "201"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "202"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "203"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "204"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "205"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "300"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "301"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "302"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "303"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "304"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "305"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "400"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "401"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "402"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "403"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "404"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "405"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "500"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "501"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "502"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "503"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "504"
assert d.can_increment()
d.increment()
assert d.get_curr_value() == "505"
assert not d.can_increment()
print "ALL COUNTER TESTS PASS"