core: Resolve a FIXME in str module
This commit is contained in:
parent
4601810747
commit
9691ce18a2
1 changed files with 6 additions and 3 deletions
|
@ -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 @@ mod tests {
|
|||
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…
Add table
Add a link
Reference in a new issue