Skip to content

Commit

Permalink
Add test mixing large/small args in randint
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOverlord authored and xiaq committed Jan 5, 2025
1 parent d078bc1 commit 5aafdd5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/eval/builtin_fn_num_test.elvts
Original file line number Diff line number Diff line change
Expand Up @@ -614,3 +614,22 @@ Exception: bad value: step must be negative, but is 0.5
~> range 1.2 >&-
Exception: port does not support value output
[tty]:1:1-13: range 1.2 >&-

## randint big arguments mixed ##
~> var bound = 100000000000000000000000000
var x = (randint $bound)
and (<= 0 $x) (< $x $bound)
▶ $true
~> var bound = 100000000000000000000000000
var x = (randint 0 $bound)
and (<= 0 $x) (< $x $bound)
▶ $true
~> var bound = 100000000000000000000000000
var x = (randint -$bound $bound)
and (<= -$bound $x) (< $x $bound)
▶ $true
~> var bound = 100000000000000000000000000
var x = (randint -$bound 0)
and (<= -$bound $x) (< $x 0)
▶ $true

0 comments on commit 5aafdd5

Please sign in to comment.