Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Feb 28, 2022
1 parent 5774a88 commit 3740263
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test/Tests/src/Data/Text_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3740263

Please sign in to comment.