aboutsummaryrefslogtreecommitdiff
path: root/tests/string.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/string.test')
-rw-r--r--tests/string.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/string.test b/tests/string.test
index c2d5f10..6a70b79 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -809,4 +809,19 @@ test string-20.5 {string trimright} {
string trimright ""
} {}
+# Test for 8-bit clean and utf-8 trim chars
+test string-21.1 {string trim embedded nulls} {
+ string trim " abc\x00def "
+} "abc\x00def"
+test string-21.2 {string trimleft embedded nulls} {
+ string trimleft " abc\x00def "
+} "abc\x00def "
+test string-21.3 {string trimright embedded nulls} {
+ string trimright " abc\x00def "
+} " abc\x00def"
+test string-21.4 {string trim utf-8} {
+ string trim "\u00b5\u00b6abc\x00def\u00b5\u00b5" "\u00b5\u00b6"
+} "abc\x00def"
+
+
testreport