diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2015-07-31 00:04:55 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2015-07-31 00:04:55 +0200 |
| commit | 8aa45877ec4b55d0a01126eb32820a1ebbab3513 (patch) | |
| tree | 39b8464d4cd4f57585fd4c182fe7401ea2cb8210 /test.py | |
| parent | added randbelow and shuffle methods (diff) | |
| download | SyncRNG-8aa45877ec4b55d0a01126eb32820a1ebbab3513.tar.gz SyncRNG-8aa45877ec4b55d0a01126eb32820a1ebbab3513.zip | |
added tests
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -0,0 +1,34 @@ + +from SyncRNG import SyncRNG + +def test_randi(): + s = SyncRNG(seed=123456) + for i in range(5): + print(s.randi()) + +def test_rand(): + s = SyncRNG(seed=123456) + for i in range(5): + print(s.rand()) + +def test_randbelow(): + s = SyncRNG(seed=123456) + for i in range(5): + print(s.randbelow(i+1)) + +def test_shuffle(): + s = SyncRNG(seed=123456) + x = [1, 2, 3, 4, 5] + for i in range(5): + y = s.shuffle(x) + x = y + print(y) + +def main(): + test_randi() + test_rand() + test_randbelow() + test_shuffle() + +if __name__ == '__main__': + main() |
