diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-21 00:59:05 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-21 01:03:13 -0800 |
| commit | 9691ce18a2674e322be4b2e8f2e44888eb957170 (patch) | |
| tree | facd06d141adedb1e5be4f1027ac383c68fd766d /src/libcore | |
| parent | 46018107474675ece9b7ef482d2ff1be1086d085 (diff) | |
| download | rust-9691ce18a2674e322be4b2e8f2e44888eb957170.tar.gz rust-9691ce18a2674e322be4b2e8f2e44888eb957170.zip | |
core: Resolve a FIXME in str module
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/str.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 0a44d1fb414..2c7c55418da 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -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) } } } @@ -2298,6 +2296,11 @@ mod tests { } #[test] + fn test_escape_char() { + assert escape_char('\x1f') == "\\x1f"; + } + + #[test] fn test_map() { assert "" == map("", char::to_upper); assert "YMCA" == map("ymca", char::to_upper); |
