Browse files

have get_random_object return negative numbers

  • Loading branch information...
1 parent 5207d40 commit 1e42caba70ee962a64f374cdbf75604af68d5b90 @rfk committed Apr 4, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 tnetstring/tests/test_format.py
View
5 tnetstring/tests/test_format.py
@@ -58,7 +58,10 @@ def get_random_object(random=random,depth=0,jsonsafe=False):
if what == 2:
return False
if what == 3:
- return random.randint(0,sys.maxint)
+ if random.randint(0,1) == 0:
+ return random.randint(0,sys.maxint)
+ else:
+ return -1 * random.randint(0,sys.maxint)
# cjson can't reliably round-trip floats.
if what == 4 and not jsonsafe:
return random.randint(0,sys.maxint)*1.0/random.randint(0,sys.maxint)

0 comments on commit 1e42cab

Please sign in to comment.