core: Resolve a FIXME in str module
This commit is contained in:
parent
4601810747
commit
9691ce18a2
@ -1329,9 +1329,7 @@ fn escape_char(c: char) -> str {
|
||||
'\n' { "\\n" }
|
||||
'\t' { "\\t" }
|
||||
'\r' { "\\r" }
|
||||
// FIXME: uncomment this when extfmt is moved to core
|
||||
// in a snapshot.
|
||||
// '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
|
||||
'\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
|
||||
v { from_char(c) }
|
||||
}
|
||||
}
|
||||
@ -2297,6 +2295,11 @@ fn test_escape() {
|
||||
assert(escape("abc\"def") == "abc\\\"def");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_escape_char() {
|
||||
assert escape_char('\x1f') == "\\x1f";
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_map() {
|
||||
assert "" == map("", char::to_upper);
|
||||
|
Loading…
Reference in New Issue
Block a user