Skip to content

Commit

Permalink
test/cases: add test case for rand.intn (#5207)
Browse files Browse the repository at this point in the history
It looks like we didn't have any before. While it's inherently random, we still
know that for the same inputs, within a single evaluation run, we should only
get one output. So let's assert that.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
  • Loading branch information
srenatus committed Oct 5, 2022
1 parent f3c0630 commit 20982c3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/cases/testdata/rand/test-rand.intn.yaml
@@ -0,0 +1,13 @@
cases:
- data:
modules:
- |
package test
p = count(rands) {
rands := { rand.intn("key", 100) | numbers.range(1,100)[_] }
}
note: rand.intn/consistent values for same arguments
query: data.test.p = x
want_result:
- x: 1

0 comments on commit 20982c3

Please sign in to comment.