Skip to content

Commit

Permalink
tests: Add some more tests for complex numbers and ure module.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgeorge committed Mar 14, 2015
1 parent fa1edff commit f256cfe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions tests/extmod/ure1.py
Expand Up @@ -56,3 +56,9 @@

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))
10 changes: 5 additions & 5 deletions tests/float/complex1.py
Expand Up @@ -13,7 +13,7 @@
# unary ops
print(bool(1j))
print(+(1j))
#print(-(1j)) uPy doesn't print correctly
print(-(1 + 2j))

# binary ops
print(1j + 2)
Expand All @@ -23,10 +23,10 @@
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))

0 comments on commit f256cfe

Please sign in to comment.