Skip to content

Commit d87f23a

Browse files
committed
---
yaml --- r: 11897 b: refs/heads/master c: 26b54cc h: refs/heads/master i: 11895: a054e68 v: v3
1 parent e9c730c commit d87f23a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f67f2388f717fc474cf9af5c13b75675209df58d
2+
refs/heads/master: 26b54cc17e13e3d784d3f25bdbe500ec18cefd7b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/char.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,23 @@ pure fn to_digit(c: char, radix: uint) -> option<uint> {
123123
}
124124

125125
/*
126-
FIXME: works only on ASCII
126+
FIXME: works only on ASCII (Issue #1985)
127127
*/
128128
#[doc = "Convert a char to the corresponding lower case."]
129129
pure fn to_lower(c: char) -> char {
130+
assert is_ascii(c);
130131
alt c {
131132
'A' to 'Z' { ((c as u8) + 32u8) as char }
132133
_ { c }
133134
}
134135
}
135136

136137
/*
137-
FIXME: works only on ASCII
138+
FIXME: works only on ASCII (Issue 1985)
138139
*/
139140
#[doc = "Convert a char to the corresponding upper case."]
140141
pure fn to_upper(c: char) -> char {
142+
assert is_ascii(c);
141143
alt c {
142144
'a' to 'z' { ((c as u8) - 32u8) as char }
143145
_ { c }
@@ -208,16 +210,18 @@ fn test_to_digit() {
208210
fn test_to_lower() {
209211
assert (to_lower('H') == 'h');
210212
assert (to_lower('e') == 'e');
213+
// non-ASCII, shouldn't work (see earlier FIXME)
211214
//assert (to_lower('Ö') == 'ö');
212-
assert (to_lower('ß') == 'ß');
215+
//assert (to_lower('ß') == 'ß');
213216
}
214217

215218
#[test]
216219
fn test_to_upper() {
217220
assert (to_upper('l') == 'L');
218221
assert (to_upper('Q') == 'Q');
222+
// non-ASCII, shouldn't work (see earlier FIXME)
219223
//assert (to_upper('ü') == 'Ü');
220-
assert (to_upper('ß') == 'ß');
224+
//assert (to_upper('ß') == 'ß');
221225
}
222226

223227
#[test]

0 commit comments

Comments
 (0)