diff options
| author | ruki <[email protected]> | 2026-01-21 22:09:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-01-21 22:09:09 +0800 |
| commit | 197dfb660a35825d0bb46f8ef69884d7ec00c410 (patch) | |
| tree | 271f4bce14ac31a35f89c7df2e51c27b27025043 /tests/modules/string | |
| parent | 3a602442ced657fd07d9890176f1bc24ea1b346f (diff) | |
fix path.filename and lastof
Diffstat (limited to 'tests/modules/string')
| -rw-r--r-- | tests/modules/string/test.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modules/string/test.lua b/tests/modules/string/test.lua index 94b3c1a04..4b093de45 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) |
