From 3740263d27c589c855d8a4802320c2aae1fe52d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Wa=C5=9Bko?= Date: Mon, 28 Feb 2022 13:08:43 +0100 Subject: [PATCH] Add more tests --- test/Tests/src/Data/Text_Spec.enso | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/Tests/src/Data/Text_Spec.enso b/test/Tests/src/Data/Text_Spec.enso index 4ba8240abc2d..c330dc903c05 100644 --- a/test/Tests/src/Data/Text_Spec.enso +++ b/test/Tests/src/Data/Text_Spec.enso @@ -302,11 +302,31 @@ spec = Test.specify "should correctly convert character case" <| "FooBar Baz".to_case Case.Lower . should_equal "foobar baz" "FooBar Baz".to_case Case.Upper . should_equal "FOOBAR BAZ" + + "foo bar baz".to_case Case.Title . should_equal "Foo Bar Baz" + "foo-bar, baz.baz foo_foo".to_case Case.Title . should_equal "Foo-Bar, Baz.baz Foo_foo" + "i".to_case Case.Upper . should_equal "I" "I".to_case Case.Lower . should_equal "i" "i".to_case Case.Upper (Locale.new "tr") . should_equal "İ" "I".to_case Case.Lower (Locale.new "tr") . should_equal "ı" - "foo bar baz".to_case Case.Title . should_equal "Foo Bar Baz" + "İ".to_case Case.Lower . should_equal "i̇" + "ı".to_case Case.Upper . should_equal "I" + + "Straße".to_case Case.Upper . should_equal "STRASSE" + "STRASSE".to_case Case.Lower . should_equal "strasse" + "et cætera".to_case Case.Upper . should_equal "ET CÆTERA" + ("β".to_case Case.Upper == "B") . should_be_false + "δλφξ".to_case Case.Upper . should_equal "ΔΛΦΞ" + "ΔΛΦΞ".to_case Case.Lower . should_equal "δλφξ" + "δλ φξ".to_case Case.Title . should_equal "Δλ Φξ" + + '✨🚀🚧😍😃😎😙😉☺'.to_case Case.Upper . should_equal '✨🚀🚧😍😃😎😙😉☺' + '✨🚀🚧😍😃😎😙😉☺'.to_case Case.Lower . should_equal '✨🚀🚧😍😃😎😙😉☺' + '✨🚀🚧😍😃😎😙😉☺'.to_case Case.Title . should_equal '✨🚀🚧😍😃😎😙😉☺' + + "123".to_case Case.Upper . should_equal "123" + "abc123".to_case Case.Upper . should_equal "ABC123" Test.specify "should dump utf-16 characters to a vector" <| kshi_chars = kshi.utf_16