Skip to content

Commit bea520f

Browse files
committed
Break out compare tests
1 parent 4a76261 commit bea520f

File tree

2 files changed

+37
-38
lines changed

2 files changed

+37
-38
lines changed

test/test_compare.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from cstring import cstring
2+
3+
4+
def test_eq():
5+
a = cstring('hello')
6+
b = cstring('hello')
7+
assert a is not b
8+
assert a == b
9+
10+
11+
def test_neq():
12+
assert cstring('hello') != cstring('world')
13+
14+
15+
def test_ne():
16+
assert cstring('hello') != cstring('world')
17+
18+
19+
def test_lt():
20+
assert cstring('a') < cstring('b')
21+
assert cstring('a') < cstring('aa')
22+
23+
24+
def test_le():
25+
assert cstring('a') <= cstring('a')
26+
assert cstring('a') <= cstring('b')
27+
28+
29+
def test_gt():
30+
assert cstring('b') > cstring('a')
31+
assert cstring('aa') > cstring('a')
32+
33+
34+
def test_ge():
35+
assert cstring('a') >= cstring('a')
36+
assert cstring('b') >= cstring('a')
37+

test/test_cstring.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,3 @@ def test_hash():
1212
assert a is not b
1313
assert set((a, b)) == set((a,)) == set((b,))
1414

15-
16-
# Rich Compare
17-
18-
19-
def test_eq():
20-
a = cstring('hello')
21-
b = cstring('hello')
22-
assert a is not b
23-
assert a == b
24-
25-
26-
def test_neq():
27-
assert cstring('hello') != cstring('world')
28-
29-
30-
def test_ne():
31-
assert cstring('hello') != cstring('world')
32-
33-
34-
def test_lt():
35-
assert cstring('a') < cstring('b')
36-
assert cstring('a') < cstring('aa')
37-
38-
39-
def test_le():
40-
assert cstring('a') <= cstring('a')
41-
assert cstring('a') <= cstring('b')
42-
43-
44-
def test_gt():
45-
assert cstring('b') > cstring('a')
46-
assert cstring('aa') > cstring('a')
47-
48-
49-
def test_ge():
50-
assert cstring('a') >= cstring('a')
51-
assert cstring('b') >= cstring('a')
52-

0 commit comments

Comments
 (0)