Skip to content

Commit

Permalink
Implement title case
Browse files Browse the repository at this point in the history
TODO: some more tests would be good
  • Loading branch information
radeusgd committed Feb 28, 2022
1 parent 04edb3e commit 5774a88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1015,4 +1015,4 @@ Text.to_case : Case -> Locale -> Text
Text.to_case case_option=Case.Lower locale=Locale.Default = case case_option of
Case.Lower -> UCharacter.toLowerCase locale.java_locale this
Case.Upper -> UCharacter.toUpperCase locale.java_locale this
Case.Title -> Error.throw "TODO"
Case.Title -> UCharacter.toTitleCase locale.java_locale this Nothing
1 change: 1 addition & 0 deletions test/Tests/src/Data/Text_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ spec =
"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"

Test.specify "should dump utf-16 characters to a vector" <|
kshi_chars = kshi.utf_16
Expand Down

0 comments on commit 5774a88

Please sign in to comment.