summaryrefslogtreecommitdiff
path: root/tests/modules/string
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-18 14:51:59 +0800
committerGitHub <[email protected]>2026-01-18 14:51:59 +0800
commitd5705110a292f193fb2d202de8115f5933fc9fcc (patch)
tree5ce6616765b63197caafe5f377f9c6ea922c5ea2 /tests/modules/string
parente8a618fab3758a3ca1b0b630d7c5b0dc4e08a7c5 (diff)
parenta1c0eaed71793cd3761dbcf6b2a4cab6c6474434 (diff)
Merge pull request #7235 from luadebug/case
add string case conversion functions: lower and upper
Diffstat (limited to 'tests/modules/string')
-rw-r--r--tests/modules/string/test.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/modules/string/test.lua b/tests/modules/string/test.lua
index 3f52dc593..94b3c1a04 100644
--- a/tests/modules/string/test.lua
+++ b/tests/modules/string/test.lua
@@ -106,3 +106,12 @@ function test_replace(t)
t:are_equal(("123$xyz456xyz789xyz"):replace("123$", "000", {plain = true}), "000xyz456xyz789xyz")
t:are_equal(("123xyz$456xyz$789xyz$"):replace("xyz$", "000", {plain = true}), "123000456000789000")
end
+
+function test_case(t)
+ t:are_equal(("Hello"):lower(), "hello")
+ t:are_equal(("Hello"):upper(), "HELLO")
+ t:are_equal(("Звезда Хэнсин"):lower(), "звезда хэнсин")
+ t:are_equal(("Звезда Хэнсин"):upper(), "ЗВЕЗДА ХЭНСИН")
+ t:are_equal(("Test 源文件🎆 Message"):lower(), "test 源文件🎆 message")
+ t:are_equal(("Test 源文件🎆 Message"):upper(), "TEST 源文件🎆 MESSAGE")
+end