tests: Add some more tests for complex numbers and ure module.

pull/1157/head
Damien George 2015-03-14 22:56:02 +00:00
rodzic fa1edff006
commit f256cfef4f
2 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -56,3 +56,9 @@ print(m.group(0))
m = re.search("w.r", "hello world")
print(m.group(0))
m = re.match('a+?', 'ab'); print(m.group(0))
m = re.match('a*?', 'ab'); print(m.group(0))
m = re.match('^ab$', 'ab'); print(m.group(0))
m = re.match('a|b', 'b'); print(m.group(0))
m = re.match('a|b|c', 'c'); print(m.group(0))

Wyświetl plik

@ -13,7 +13,7 @@ print(complex(1j, 2j))
# unary ops
print(bool(1j))
print(+(1j))
#print(-(1j)) uPy doesn't print correctly
print(-(1 + 2j))
# binary ops
print(1j + 2)
@ -23,10 +23,10 @@ print(1j - 2j)
print(1j * 2)
print(1j * 2j)
print(1j / 2)
#print(1j / 2j) uPy doesn't print correctly
#print(1j ** 2) uPy doesn't print correctly
#print(1j ** 2j) uPy doesn't print correctly
print(1j / (1 + 2j))
ans = 1j ** 2.5; print("%.5g %.5g" % (ans.real, ans.imag))
ans = 1j ** 2.5j; print("%.5g %.5g" % (ans.real, ans.imag))
# builtin abs
print(abs(1j))
print(abs(1j + 2))
print("%.5g" % abs(1j + 2))