mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Mirror interpreter implementation: - use builtins::must_cache to determine whether builtin must be cached. - reuse cached value when applicable - clear the VM’s builtin cache whenever execution state resets to avoid leaking values across runs - add a YAML regression for rand.intn set comprehensions and re-enable the rand cases in the OPA test suite Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
16 lines
327 B
YAML
16 lines
327 B
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
cases:
|
|
- note: builtin_rand_intn_cache_consistency
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
rands := { rand.intn("seed", 100) | numbers.range(1, 100)[_] }
|
|
|
|
np := count(rands)
|
|
query: data.test.np
|
|
want_result: 1
|