core: Resolve a FIXME in str module

This commit is contained in:
Brian Anderson 2012-02-21 00:59:05 -08:00
parent 4601810747
commit 9691ce18a2

View File

@ -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);