diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/extmod/urandom_basic.py | 7 | ||||
| -rw-r--r-- | tests/extmod/urandom_basic.py.exp | 4 |
2 files changed, 9 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") diff --git a/tests/extmod/urandom_basic.py.exp b/tests/extmod/urandom_basic.py.exp new file mode 100644 index 000000000..d629828d7 --- /dev/null +++ b/tests/extmod/urandom_basic.py.exp @@ -0,0 +1,4 @@ +True +True +0 +ValueError |
