Added some more string tests

This commit is contained in:
Zef Hemel
2025-02-08 20:32:42 +01:00
parent d57792af6d
commit 6699ac783f
2 changed files with 23 additions and 7 deletions
+4
View File
@@ -76,6 +76,10 @@ local m1, m2 = string.match("hello world", "(h)(ello)")
assertEqual(m1, "h")
assertEqual(m2, "ello")
-- Test with pattern with character class
assertEqual(string.match("c", "[abc]"), "c")
-- Test match with init position - need to capture the group
local initMatch = string.match("hello world", "(world)", 7)
assertEqual(initMatch, "world")