Generate error if RegEx offset is negative

This commit is contained in:
Marcel Admiraal 2021-04-25 12:53:22 +01:00
parent 6ba7dacf6b
commit db1270d521
2 changed files with 4 additions and 10 deletions

View file

@ -130,16 +130,6 @@ TEST_CASE("[RegEx] Empty Pattern") {
CHECK(re.is_valid());
}
TEST_CASE("[RegEx] Invalid offset") {
const String s = "Godot";
RegEx re("o");
REQUIRE(re.is_valid());
CHECK(re.search(s, -1) == nullptr);
CHECK(re.search_all(s, -1).size() == 0);
CHECK(re.sub(s, "", true, -1) == "");
}
TEST_CASE("[RegEx] Invalid end position") {
const String s = "Godot";