From 2971238c8957df1bce0629c12d8c209b39328590 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 31 Jul 2015 16:21:25 +0200 Subject: reformat to proper python and R packages --- test/test.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/test.py (limited to 'test/test.py') diff --git a/test/test.py b/test/test.py new file mode 100644 index 0000000..ea0b79f --- /dev/null +++ b/test/test.py @@ -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() -- cgit v1.2.3