diff --git a/test/Tests/src/Data/Text_Spec.enso b/test/Tests/src/Data/Text_Spec.enso index cd02f5b8d14e8..10816a789de6a 100644 --- a/test/Tests/src/Data/Text_Spec.enso +++ b/test/Tests/src/Data/Text_Spec.enso @@ -513,6 +513,16 @@ spec = long_text . starts_with "EOL.SOL" (Regex_Matcher.new dot_matches_newline=True) . should_be_true long_text . starts_with "EOL.SOL" (Regex_Matcher.new dot_matches_newline=False) . should_be_false + "aaazzz" . starts_with "a|b" Regex_Matcher.new . should_be_true + "bbbzzz" . starts_with "a|b" Regex_Matcher.new . should_be_true + "zzzaaa" . starts_with "a|b" Regex_Matcher.new . should_be_false + "zzzbbb" . starts_with "a|b" Regex_Matcher.new . should_be_false + "aaazzz" . starts_with "(a|b){2}" Regex_Matcher.new . should_be_true + "bbbzzz" . starts_with "(a|b){2}" Regex_Matcher.new . should_be_true + "zzzaaa" . starts_with "(a|b){2}" Regex_Matcher.new . should_be_false + "foobar" . starts_with "" Regex_Matcher.new . should_be_true + "" . starts_with "" Regex_Matcher.new . should_be_true + Test.specify "should check for ends_with using Unicode normalization" <| "Hello".ends_with "lo" . should_be_true "Hello".ends_with "LO" . should_be_false @@ -581,6 +591,16 @@ spec = long_text . ends_with "EOL.SOL" (Regex_Matcher.new dot_matches_newline=True) . should_be_true long_text . ends_with "EOL.SOL" (Regex_Matcher.new dot_matches_newline=False) . should_be_false + "zzzaaa" . ends_with "a|b" Regex_Matcher.new . should_be_true + "zzzbbb" . ends_with "a|b" Regex_Matcher.new . should_be_true + "aaazzz" . ends_with "a|b" Regex_Matcher.new . should_be_false + "bbbzzz" . ends_with "a|b" Regex_Matcher.new . should_be_false + "zzzaaa" . ends_with "(a|b){2}" Regex_Matcher.new . should_be_true + "zzzbbb" . ends_with "(a|b){2}" Regex_Matcher.new . should_be_true + "aaazzz" . ends_with "(a|b){2}" Regex_Matcher.new . should_be_false + "foobar" . ends_with "" Regex_Matcher.new . should_be_true + "" . ends_with "" Regex_Matcher.new . should_be_true + Test.group "Regex matching" <| Test.specify "should be possible on text" <| match = "My Text: Goes Here".match "^My Text: (.+)$" mode=Regex_Mode.First