builtin: add tests for rune.to_upper() (#22801)

This commit is contained in:
yuyi 2024-11-08 21:10:30 +08:00 committed by GitHub
parent 43d9cd6e90
commit 43afa8d94e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,3 +40,36 @@ fn test_bytes() {
r1 := ``
assert r1.bytes() == [u8(0xe2), 0x98, 0x85]
}
fn test_to_upper() {
assert `c`.to_upper() == `C`
assert `C`.to_upper() == `C`
assert `δ`.to_upper() == `Δ`
assert `Δ`.to_upper() == `Δ`
assert `ā`.to_upper() == `Ā`
assert `Ā`.to_upper() == `Ā`
assert `Я`.to_upper() == `Я`
assert `я`.to_upper() == `Я`
}
fn test_to_lower() {
assert `C`.to_lower() == `c`
assert `c`.to_lower() == `c`
assert `Δ`.to_lower() == `δ`
assert `δ`.to_lower() == `δ`
assert `Ā`.to_lower() == `ā`
assert `ā`.to_lower() == `ā`
assert `я`.to_lower() == `я`
assert `Я`.to_lower() == `я`
}
fn test_to_title() {
assert `c`.to_title() == `C`
assert `C`.to_title() == `C`
assert `δ`.to_title() == `Δ`
assert `Δ`.to_title() == `Δ`
assert `ā`.to_title() == `Ā`
assert `Ā`.to_title() == `Ā`
assert `я`.to_title() == `Я`
assert `Я`.to_title() == `Я`
}