builtin.string: fix is_upper and is_lower with numbers (#21357)

This commit is contained in:
Swastik Baranwal 2024-04-26 18:50:21 +05:30 committed by GitHub
parent 6c113cf777
commit c7af2c21d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -1013,6 +1013,9 @@ fn test_lower() {
assert s.to_lower() == 'hi'
assert 'aloha!'[0] == `a`
assert 'aloha!'[5] == `!`
s = '123'
assert !s.is_lower()
assert s.to_lower() == '123'
}
fn test_upper() {
@ -1033,6 +1036,9 @@ fn test_upper() {
s = 'HI'
assert s.is_upper()
assert s.to_upper() == 'HI'
s = '123'
assert !s.is_upper()
assert s.to_upper() == '123'
}
fn test_capitalize() {