Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more tests
  • Loading branch information
Tim-St committed Sep 29, 2019
commit 804ee41d5e3cc31512fd334676bc77699ad36db7
2 changes: 2 additions & 0 deletions py/tests/float.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
assert repr(float("1.11")) == "1.11"
assert repr(float("-1.0")) == "-1.0"
assert repr(float("1.00101")) == "1.00101"
assert repr(float("1.00")) == "1.0"
assert repr(float("2.010")) == "2.01"
assertRaises(ValueError, float, "1 E200")

doc="finished"
2 changes: 2 additions & 0 deletions py/tests/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
assert str([1,2,3]) == "[1, 2, 3]"
assert str([1,[2,3],4]) == "[1, [2, 3], 4]"
assert str(["1",[2.5,17,[]]]) == "['1', [2.5, 17, []]]"
assert str([1, 1.0]) == "[1, 1.0]"

doc="repr"
assert repr([]) == "[]"
assert repr([1,2,3]) == "[1, 2, 3]"
assert repr([1,[2,3],4]) == "[1, [2, 3], 4]"
assert repr(["1",[2.5,17,[]]]) == "['1', [2.5, 17, []]]"
assert repr([1, 1.0]) == "[1, 1.0]"

doc="enumerate"
a = [e for e in enumerate([3,4,5,6,7], 4)]
Expand Down
2 changes: 2 additions & 0 deletions py/tests/tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
assert str((1,2,3)) == "(1, 2, 3)"
assert str((1,(2,3),4)) == "(1, (2, 3), 4)"
assert str(("1",(2.5,17,()))) == "('1', (2.5, 17, ()))"
assert str((1, 1.0)) == "(1, 1.0)"

doc="repr"
assert repr(()) == "()"
assert repr((1,2,3)) == "(1, 2, 3)"
assert repr((1,(2,3),4)) == "(1, (2, 3), 4)"
assert repr(("1",(2.5,17,()))) == "('1', (2.5, 17, ()))"
assert repr((1, 1.0)) == "(1, 1.0)"

doc="mul"
a = (1, 2, 3)
Expand Down