Skip to content

Commit 01751d9

Browse files
committed
TEST: Add for random()
1 parent c25abe9 commit 01751d9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ RUN(NAME elemental_11 LABELS cpython llvm c NOFAST)
600600
RUN(NAME elemental_12 LABELS cpython llvm c NOFAST)
601601
RUN(NAME elemental_13 LABELS cpython llvm c NOFAST)
602602
RUN(NAME test_random LABELS cpython llvm NOFAST)
603+
RUN(NAME test_random_02 LABELS cpython llvm NOFAST)
603604
RUN(NAME test_os LABELS cpython llvm c NOFAST)
604605
RUN(NAME test_builtin LABELS cpython llvm c)
605606
RUN(NAME test_builtin_abs LABELS cpython llvm c)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from lpython import f64
2+
import random
3+
4+
def test_seed():
5+
random.seed()
6+
t1: f64 = random.random()
7+
t2: f64 = random.random()
8+
print(t1, t2)
9+
assert abs(t1 - t2) > 1e-3
10+
11+
test_seed()

0 commit comments

Comments
 (0)