Skip to content

Commit 0f8b83c

Browse files
committed
对type.py的测试
1 parent 4426f63 commit 0f8b83c

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

test.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,42 @@ def 方法测试():
6262
print(b, type(b))
6363
print(a.isDivisible(114514), a.isDivisible(b))
6464

65+
class List测试:
66+
@staticmethod
67+
def 基本测试():
68+
a = List(["a", "b", "c"])
69+
b = ["a", "b"]
70+
c = List(["1", "2", "3"])
71+
print(a, b, c)
72+
print(a + b, a + c, c + b)
73+
74+
@staticmethod
75+
def 运算符测试():
76+
a = List([1, 2, 3])
77+
b = List([4, 5, 6])
78+
c = List([1, 2, 3])
79+
print(a == b, a == c, b == c)
80+
print(a > b, a < b, a > c, a < c, b > c, b < c)
81+
print(a != b, a != c, b != c)
82+
83+
@staticmethod
84+
def 方法测试():
85+
a = List(["1", "2", "3"])
86+
print(a.length)
87+
print(a.toIntList())
88+
b = List([1, 2, 3])
89+
print(b.length)
90+
print(b.toStrList())
91+
6592
if __name__ == "__main__":
6693
String测试.基本测试()
6794
String测试.运算符判断()
6895
String测试.方法测试()
6996

7097
Integer测试.基本测试()
7198
Integer测试.运算符判断()
72-
Integer测试.方法测试()
99+
Integer测试.方法测试()
100+
101+
List测试.基本测试()
102+
List测试.运算符测试()
103+
List测试.方法测试()

0 commit comments

Comments
 (0)