mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
Auto merge of #27915 - SimonSapin:dotted_i, r=alexcrichton
I was wrong about Unicode not having such language-independent mapping.
This commit is contained in:
commit
50ebf76f22
@ -55,28 +55,24 @@ fn test_to_digit() {
|
||||
|
||||
#[test]
|
||||
fn test_to_lowercase() {
|
||||
fn lower(c: char) -> char {
|
||||
let mut it = c.to_lowercase();
|
||||
let c = it.next().unwrap();
|
||||
// As of Unicode version 7.0.0, `SpecialCasing.txt` has no lower-case mapping
|
||||
// to multiple code points.
|
||||
assert!(it.next().is_none());
|
||||
c
|
||||
fn lower(c: char) -> Vec<char> {
|
||||
c.to_lowercase().collect()
|
||||
}
|
||||
assert_eq!(lower('A'), 'a');
|
||||
assert_eq!(lower('Ö'), 'ö');
|
||||
assert_eq!(lower('ß'), 'ß');
|
||||
assert_eq!(lower('Ü'), 'ü');
|
||||
assert_eq!(lower('💩'), '💩');
|
||||
assert_eq!(lower('Σ'), 'σ');
|
||||
assert_eq!(lower('Τ'), 'τ');
|
||||
assert_eq!(lower('Ι'), 'ι');
|
||||
assert_eq!(lower('Γ'), 'γ');
|
||||
assert_eq!(lower('Μ'), 'μ');
|
||||
assert_eq!(lower('Α'), 'α');
|
||||
assert_eq!(lower('Σ'), 'σ');
|
||||
assert_eq!(lower('Dž'), 'dž');
|
||||
assert_eq!(lower('fi'), 'fi');
|
||||
assert_eq!(lower('A'), ['a']);
|
||||
assert_eq!(lower('Ö'), ['ö']);
|
||||
assert_eq!(lower('ß'), ['ß']);
|
||||
assert_eq!(lower('Ü'), ['ü']);
|
||||
assert_eq!(lower('💩'), ['💩']);
|
||||
assert_eq!(lower('Σ'), ['σ']);
|
||||
assert_eq!(lower('Τ'), ['τ']);
|
||||
assert_eq!(lower('Ι'), ['ι']);
|
||||
assert_eq!(lower('Γ'), ['γ']);
|
||||
assert_eq!(lower('Μ'), ['μ']);
|
||||
assert_eq!(lower('Α'), ['α']);
|
||||
assert_eq!(lower('Σ'), ['σ']);
|
||||
assert_eq!(lower('Dž'), ['dž']);
|
||||
assert_eq!(lower('fi'), ['fi']);
|
||||
assert_eq!(lower('İ'), ['i', '\u{307}']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user