File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1922,6 +1922,21 @@ fn word_to_titlecase() {
19221922 expected. push_str( & str :: repeat( "a" , 510 ) ) ;
19231923 expected
19241924 } ) ;
1925+
1926+ // LJ ligatures and title-case characters.
1927+ // Lj is already a title-case letter, so it stays as the first char.
1928+ assert_eq ! ( "Ljj" . word_to_titlecase( ) , "Ljj" ) ;
1929+ assert_eq ! ( "LjJ" . word_to_titlecase( ) , "Ljj" ) ;
1930+ // l is the first cased char (uppercases to L), Lj lowercases to lj.
1931+ assert_eq ! ( "lLjfi" . word_to_titlecase( ) , "Lljfi" ) ;
1932+ assert_eq ! ( "LLjfi" . word_to_titlecase( ) , "Lljfi" ) ;
1933+
1934+ // LJ ligatures: lower=lj (U+01C9), upper=LJ (U+01C7), title=Lj (U+01C8).
1935+ // ß decomposes to "Ss" in title case (first char) but stays ß elsewhere.
1936+ assert_eq ! ( "ßljLJLj" . word_to_titlecase( ) , "Ssljljlj" ) ;
1937+ assert_eq ! ( "ljLJLjß" . word_to_titlecase( ) , "Ljljljß" ) ;
1938+ assert_eq ! ( "LJLjßlj" . word_to_titlecase( ) , "Ljljßlj" ) ;
1939+ assert_eq ! ( "LjßljLJ" . word_to_titlecase( ) , "Ljßljlj" ) ;
19251940}
19261941
19271942#[ test]
You can’t perform that action at this time.
0 commit comments