about summary refs log tree commit diff
path: root/src/libcore/tests
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-07-26 15:03:49 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-07-30 18:18:23 +0200
commit4ca77f702f813332defe15a0aa73707628bf592e (patch)
tree9720df5b626870e9f4ef23fed70fe802acfa0fc9 /src/libcore/tests
parentd8b3c830fbcdd14d085209a8dcc3399151f3286a (diff)
downloadrust-4ca77f702f813332defe15a0aa73707628bf592e.tar.gz
rust-4ca77f702f813332defe15a0aa73707628bf592e.zip
Remove unstable and deprecated APIs
Diffstat (limited to 'src/libcore/tests')
-rw-r--r--src/libcore/tests/char.rs51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/libcore/tests/char.rs b/src/libcore/tests/char.rs
index d2a9ed75be6..46c54056e2c 100644
--- a/src/libcore/tests/char.rs
+++ b/src/libcore/tests/char.rs
@@ -363,54 +363,3 @@ fn eu_iterator_specializations() {
     check('\u{12340}');
     check('\u{10FFFF}');
 }
-
-#[test]
-#[allow(deprecated)]
-fn test_decode_utf8() {
-    macro_rules! assert_decode_utf8 {
-        ($input_bytes: expr, $expected_str: expr) => {
-            let input_bytes: &[u8] = &$input_bytes;
-            let s = char::decode_utf8(input_bytes.iter().cloned())
-                .map(|r_b| r_b.unwrap_or('\u{FFFD}'))
-                .collect::<String>();
-            assert_eq!(s, $expected_str,
-                       "input bytes: {:?}, expected str: {:?}, result: {:?}",
-                       input_bytes, $expected_str, s);
-            assert_eq!(String::from_utf8_lossy(&$input_bytes), $expected_str);
-        }
-    }
-
-    assert_decode_utf8!([], "");
-    assert_decode_utf8!([0x41], "A");
-    assert_decode_utf8!([0xC1, 0x81], "��");
-    assert_decode_utf8!([0xE2, 0x99, 0xA5], "♥");
-    assert_decode_utf8!([0xE2, 0x99, 0xA5, 0x41], "♥A");
-    assert_decode_utf8!([0xE2, 0x99], "�");
-    assert_decode_utf8!([0xE2, 0x99, 0x41], "�A");
-    assert_decode_utf8!([0xC0], "�");
-    assert_decode_utf8!([0xC0, 0x41], "�A");
-    assert_decode_utf8!([0x80], "�");
-    assert_decode_utf8!([0x80, 0x41], "�A");
-    assert_decode_utf8!([0xFE], "�");
-    assert_decode_utf8!([0xFE, 0x41], "�A");
-    assert_decode_utf8!([0xFF], "�");
-    assert_decode_utf8!([0xFF, 0x41], "�A");
-    assert_decode_utf8!([0xC0, 0x80], "��");
-
-    // Surrogates
-    assert_decode_utf8!([0xED, 0x9F, 0xBF], "\u{D7FF}");
-    assert_decode_utf8!([0xED, 0xA0, 0x80], "���");
-    assert_decode_utf8!([0xED, 0xBF, 0x80], "���");
-    assert_decode_utf8!([0xEE, 0x80, 0x80], "\u{E000}");
-
-    // char::MAX
-    assert_decode_utf8!([0xF4, 0x8F, 0xBF, 0xBF], "\u{10FFFF}");
-    assert_decode_utf8!([0xF4, 0x8F, 0xBF, 0x41], "�A");
-    assert_decode_utf8!([0xF4, 0x90, 0x80, 0x80], "����");
-
-    // 5 and 6 bytes sequence
-    // Part of the original design of UTF-8,
-    // but invalid now that UTF-8 is artificially restricted to match the range of UTF-16.
-    assert_decode_utf8!([0xF8, 0x80, 0x80, 0x80, 0x80], "�����");
-    assert_decode_utf8!([0xFC, 0x80, 0x80, 0x80, 0x80, 0x80], "������");
-}