add tests that the regex returns an empty DFA when the regexString contains the endMarker

This commit is contained in:
2025-10-09 05:44:35 +01:00
parent f32a53aabc
commit 5d7b9e35ba

View File

@@ -102,5 +102,22 @@ struct
end)
]
val tests = [caseInsensitiveTests, caseSensitiveTests]
val endMarkerTests = describe "regex endMarker"
[test "returns an empty DFA when regexString contains endMarker" (fn _ =>
let
(* arrange *)
(* the end marker is #"\^@" *)
val regexString = "hello \^@ world"
(* act *)
val dfa = CsDfa.fromString regexString
(* assert *)
val actualLength = Vector.length dfa
val expectedLength = 0
in
Expect.isTrue (actualLength = expectedLength)
end)]
val tests = [caseInsensitiveTests, caseSensitiveTests, endMarkerTests]
end