From 2c2ca73770c9d382651b9a9d48f142f6a0c0be5a Mon Sep 17 00:00:00 2001 From: Daniel Larraz Date: Tue, 26 Sep 2023 15:55:50 -0500 Subject: [PATCH] Fix and extend test suite --- tests/ounit/lustre/testLustreFrontend.ml | 2 +- tests/regression/success/const_parameters.lus | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/regression/success/const_parameters.lus diff --git a/tests/ounit/lustre/testLustreFrontend.ml b/tests/ounit/lustre/testLustreFrontend.ml index 7a742652f..4b7b18a5d 100644 --- a/tests/ounit/lustre/testLustreFrontend.ml +++ b/tests/ounit/lustre/testLustreFrontend.ml @@ -57,7 +57,7 @@ let _ = run_test_tt_main ("frontend LustreAstInlineConstants error tests" >::: [ | Error (`LustreAstInlineConstantsError (_, FreeIntIdentifier _)) -> true | _ -> false); mk_test "test symbolic subrange bound 2" (fun () -> - match load_file "./lustreTypeChecker/bad_subrange_bound_2.lus" with + match load_file "./lustreTypeChecker/symbolic_subrange_bound_2.lus" with | Error (`LustreAstInlineConstantsError (_, FreeIntIdentifier _)) -> true | _ -> false); ]) diff --git a/tests/regression/success/const_parameters.lus b/tests/regression/success/const_parameters.lus new file mode 100644 index 000000000..a69df038b --- /dev/null +++ b/tests/regression/success/const_parameters.lus @@ -0,0 +1,18 @@ + +node F() returns (x,y:int) +let + x = 1; y = 2; +tel + +node N(x,y:int;const n: int;m:int) returns (z:int); +let + z = if C>0 then y+m else x+n; +tel + +const C, W:int; + +node M(t:int) returns (z:int); +let + z=N(F(), if C>0 then (W+3, t+1) else (2*C, C)); + check z=t+3 or z=2*C+1; +tel