diff options
Diffstat (limited to 'tests/extmod/urandom_basic.py')
-rw-r--r-- | tests/extmod/urandom_basic.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/extmod/urandom_basic.py b/tests/extmod/urandom_basic.py index 180197398..f7f5a6d69 100644 --- a/tests/extmod/urandom_basic.py +++ b/tests/extmod/urandom_basic.py @@ -22,8 +22,11 @@ r = random.getrandbits(16) random.seed(1) print(random.getrandbits(16) == r) -# check that it throws an error for zero bits +# check that zero bits works +print(random.getrandbits(0)) + +# check that it throws an error for negative bits try: - random.getrandbits(0) + random.getrandbits(-1) except ValueError: print("ValueError") |