Commit f256cfef authored by Damien George's avatar Damien George
Browse files

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

parent fa1edff0
......@@ -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))
......@@ -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))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment