From d89d7be490f0bece8b8cb080cfaaf7450c00d5ff Mon Sep 17 00:00:00 2001 From: Daniel Fremont Date: Tue, 9 Jul 2024 14:17:41 -0700 Subject: [PATCH] add test for VerifaiSampler with more than 10 features --- tests/syntax/test_verifai_samplers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/syntax/test_verifai_samplers.py b/tests/syntax/test_verifai_samplers.py index be57756c2..27e64607f 100644 --- a/tests/syntax/test_verifai_samplers.py +++ b/tests/syntax/test_verifai_samplers.py @@ -195,3 +195,11 @@ def test_noninterference(): for j in range(5): scene, iterations = scenario.generate(maxIterations=1) assert len(scenario.externalSampler.cachedSample) == 1 + + +def test_feature_order(): + scenario = compileScenic("param p = [VerifaiRange(x, x + 0.5) for x in range(105)]") + values = sampleParamP(scenario) + assert len(values) == 105 + for x, val in enumerate(values): + assert x <= val <= x + 0.5