aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/text.tm12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/text.tm b/test/text.tm
index 450d8ae9..c98ca1c6 100644
--- a/test/text.tm
+++ b/test/text.tm
@@ -257,6 +257,18 @@ func main():
>> "Abc":repeat(3)
= "AbcAbcAbc"
+ >> " abc def ":trim()
+ = "abc def"
+ >> " abc123def ":trim($/{!digit}/)
+ = "123"
+ >> " abc123def ":trim($/{!digit}/, trim_left=no)
+ = " abc123"
+ >> " abc123def ":trim($/{!digit}/, trim_right=no)
+ = "123def "
+ # Only trim single whole matches that bookend the text:
+ >> "AbcAbcxxxxxxxxAbcAbc":trim($/Abc/)
+ = "AbcxxxxxxxxAbc"
+
do:
!! Testing concatenation-stability:
>> ab := Text.from_codepoint_names(["LATIN SMALL LETTER E", "COMBINING VERTICAL LINE BELOW"])