summaryrefslogtreecommitdiff
path: root/tests/modules/string/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-21 11:59:57 +0800
committerGitHub <[email protected]>2026-01-21 11:59:57 +0800
commitf8d44002372ca91bbb29cf3548c306f226e6ef4e (patch)
treebdc4a15863537a347084a5e85bf75beb75056c00 /tests/modules/string/test.lua
parent9e58120568d395b5a636daa7d0f23150fe87bb95 (diff)
parent6ff8486cd3297ca0e93518c33e32678c97128a3f (diff)
Merge pull request #7246 from xmake-io/utf8
Add utf8 module
Diffstat (limited to 'tests/modules/string/test.lua')
-rw-r--r--tests/modules/string/test.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modules/string/test.lua b/tests/modules/string/test.lua
index 94b3c1a04..1ec4b52a1 100644
--- a/tests/modules/string/test.lua
+++ b/tests/modules/string/test.lua
@@ -94,6 +94,13 @@ function test_lastof(t)
t:are_equal(("/home/file.txt"):lastof('/', true), 6)
t:are_equal(("/home/file.txt"):lastof('/home', true), 1)
t:are_equal(("/home/file.txt"):lastof('[/\\]home'), 1)
+
+ -- long string
+ local longstr = ("a"):rep(1000) .. "b"
+ t:are_equal(longstr:lastof("b"), 1001)
+ t:are_equal(longstr:lastof("a"), 1000)
+ t:are_equal(longstr:lastof("b", true), 1001)
+ t:are_equal(longstr:lastof("a", true), 1000)
end
function test_replace(t)