Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Tests for .fc.
Including the various tricky cases.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| use Test; | ||
|
|
||
| plan 12; | ||
|
|
||
| # Simple | ||
| is 'BEEF \o/'.fc, 'beef \o/', '.fc on simple string in ASCII range works'; | ||
| is 'ÝØÛ SMĚŁŁ'.fc, 'ýøû směłł', '.fc on string with non-growing case fold'; | ||
|
|
||
| # Growing to multiple graphemes | ||
| is 'Scheiße!'.fc, 'scheisse!', '.fc on ß expands to ss'; | ||
| is 'fish ʼn chips'.fc, 'fish ʼn chips', '.fc on ʼn expands to ʼn'; | ||
| is 'Leffe'.fc, 'leffe', 'ligature ff expands to ff on foldcase'; | ||
| is 'Efficient'.fc, 'efficient', 'ligature ffi expands to ffi on foldcase'; | ||
|
|
||
| # Curious cases where a foldcase does expand to a base and combiner, but NFC | ||
| # (not even NFG) actually restores it, making it a no-op for NFG strings. | ||
| is 'ǰnthn'.fc, 'ǰnthn', 'ǰ foldcases to identity under NFG (1 combiner)'; | ||
| is 'pΐvo'.fc, 'pΐvo', 'ΐ foldcases to identity under NFG (2 combiners)'; | ||
|
|
||
| # Cases where foldcase expands to precomposed and another base. | ||
| is 'BᾈR'.fc, 'bἀιr', 'ᾈ foldcases to ἀι'; | ||
| is 'BᾈR'.fc.chars, 4, 'ᾈ -> ἀι = 1 extra char'; | ||
|
|
||
| # Case where foldcase expands to base, combiner, base, and we need to compose | ||
| # the first two to maintain NFG. | ||
| is 'oῷ!'.fc, 'oῶι!', 'ῷ foldcases to ῶι'; | ||
| is 'oῷ!'.fc.chars, 4, 'ῷ -> ῶι = 1 extra char'; |