Fix coretest::char::test_to_uppercase for complex mapping
This commit is contained in:
parent
c57a4124ff
commit
c6a8d5e733
@ -58,6 +58,8 @@ 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
|
||||
}
|
||||
@ -77,25 +79,22 @@ fn test_to_lowercase() {
|
||||
|
||||
#[test]
|
||||
fn test_to_uppercase() {
|
||||
fn upper(c: char) -> char {
|
||||
let mut it = c.to_uppercase();
|
||||
let c = it.next().unwrap();
|
||||
assert!(it.next().is_none());
|
||||
c
|
||||
fn upper(c: char) -> Vec<char> {
|
||||
c.to_uppercase().collect()
|
||||
}
|
||||
assert_eq!(upper('a'), 'A');
|
||||
assert_eq!(upper('ö'), 'Ö');
|
||||
assert_eq!(upper('ß'), 'ß'); // not ẞ: Latin capital letter sharp s
|
||||
assert_eq!(upper('ü'), 'Ü');
|
||||
assert_eq!(upper('💩'), '💩');
|
||||
assert_eq!(upper('a'), ['A']);
|
||||
assert_eq!(upper('ö'), ['Ö']);
|
||||
assert_eq!(upper('ß'), ['S', 'S']); // not ẞ: Latin capital letter sharp s
|
||||
assert_eq!(upper('ü'), ['Ü']);
|
||||
assert_eq!(upper('💩'), ['💩']);
|
||||
|
||||
assert_eq!(upper('σ'), 'Σ');
|
||||
assert_eq!(upper('τ'), 'Τ');
|
||||
assert_eq!(upper('ι'), 'Ι');
|
||||
assert_eq!(upper('γ'), 'Γ');
|
||||
assert_eq!(upper('μ'), 'Μ');
|
||||
assert_eq!(upper('α'), 'Α');
|
||||
assert_eq!(upper('ς'), 'Σ');
|
||||
assert_eq!(upper('σ'), ['Σ']);
|
||||
assert_eq!(upper('τ'), ['Τ']);
|
||||
assert_eq!(upper('ι'), ['Ι']);
|
||||
assert_eq!(upper('γ'), ['Γ']);
|
||||
assert_eq!(upper('μ'), ['Μ']);
|
||||
assert_eq!(upper('α'), ['Α']);
|
||||
assert_eq!(upper('ς'), ['Σ']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user