Skip to content

Commit

Permalink
+ Added test for coerce()
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Iversen committed Jan 16, 2012
1 parent 1cec7a2 commit b15f391
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/builtin/coerce.py
@@ -0,0 +1,14 @@
print coerce(0, 0)
print coerce(1.0, 0)
print coerce(0, 1.0)
print coerce(1.0, 1.0)

try:
print coerce("foo", 1.0)
except TypeError, E:
print "Fail", E

try:
print coerce(2, "foo")
except TypeError, E:
print "Fail", E

0 comments on commit b15f391

Please sign in to comment.