aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_vm.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-07-11 03:17:10 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-07-11 03:17:10 -0300
commiteb81c07047979f3fe53383ff2a42393f0b29bd28 (patch)
treee9cac26f28e7f2ca3259be25769dfdd23e04f43b /test/test_vm.ml
parent40376c3ea009eab4db9ba27837e61d8bec310b8f (diff)
downloadSOL-eb81c07047979f3fe53383ff2a42393f0b29bd28.tar.gz
SOL-eb81c07047979f3fe53383ff2a42393f0b29bd28.zip
embedding surface, host world test, deep recursion, line tracking
Diffstat (limited to 'test/test_vm.ml')
-rw-r--r--test/test_vm.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_vm.ml b/test/test_vm.ml
index e564a83..38bbcc9 100644
--- a/test/test_vm.ml
+++ b/test/test_vm.ml
@@ -101,6 +101,16 @@ let test_length_of_strings () =
^ {| Query expression: [Length list: #("a" "b") result: R] |})
"R=2"
+let test_deep_recursion () =
+ (* The witness shrinks a thousand times; the engine must neither
+ loop nor exhaust the stack on realistic depths. *)
+ let items = String.concat " " (List.init 1000 (fun _ -> "0")) in
+ check_answers "length of a thousand elements"
+ (length_rules
+ ^ Printf.sprintf {| Query expression: [Length list: #(%s) result: R] |}
+ items)
+ "R=1000"
+
(* Bounded generation is the only enumeration. *)
let test_between_generates () =
@@ -283,6 +293,7 @@ let () =
[
Alcotest.test_case "length" `Quick test_length;
Alcotest.test_case "length over strings" `Quick test_length_of_strings;
+ Alcotest.test_case "deep recursion" `Quick test_deep_recursion;
] );
( "search",
[