about summary refs log tree commit diff
path: root/library/alloc/tests
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2022-03-26 13:35:58 -0700
committerDavid Tolnay <dtolnay@gmail.com>2022-03-27 04:49:10 -0700
commit2ac9efbe950419979050ff14feb7fb89df4806a0 (patch)
tree34f9834640f08cb7c178145550a235ea663f3d1b /library/alloc/tests
parent100f12d17026fccfc5d80527b5976dd66b228b13 (diff)
downloadrust-2ac9efbe950419979050ff14feb7fb89df4806a0.tar.gz
rust-2ac9efbe950419979050ff14feb7fb89df4806a0.zip
Debug print char 0 as '\0' rather than '\u{0}'
Diffstat (limited to 'library/alloc/tests')
-rw-r--r--library/alloc/tests/fmt.rs2
-rw-r--r--library/alloc/tests/str.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/tests/fmt.rs b/library/alloc/tests/fmt.rs
index 1575a5999f9..67e12c612db 100644
--- a/library/alloc/tests/fmt.rs
+++ b/library/alloc/tests/fmt.rs
@@ -69,7 +69,7 @@ fn test_format_macro_interface() {
     t!(format!("{:?}", "true"), "\"true\"");
     t!(format!("{:?}", "foo\nbar"), "\"foo\\nbar\"");
     t!(format!("{:?}", "foo\n\"bar\"\r\n\'baz\'\t\\qux\\"), r#""foo\n\"bar\"\r\n'baz'\t\\qux\\""#);
-    t!(format!("{:?}", "foo\0bar\x01baz\u{7f}q\u{75}x"), r#""foo\u{0}bar\u{1}baz\u{7f}qux""#);
+    t!(format!("{:?}", "foo\0bar\x01baz\u{7f}q\u{75}x"), r#""foo\0bar\u{1}baz\u{7f}qux""#);
     t!(format!("{:o}", 10_usize), "12");
     t!(format!("{:x}", 10_usize), "a");
     t!(format!("{:X}", 10_usize), "A");
diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs
index f3ed611acda..32396e35696 100644
--- a/library/alloc/tests/str.rs
+++ b/library/alloc/tests/str.rs
@@ -1116,7 +1116,7 @@ fn test_escape_debug() {
     assert_eq!("abc".escape_debug().to_string(), "abc");
     assert_eq!("a c".escape_debug().to_string(), "a c");
     assert_eq!("éèê".escape_debug().to_string(), "éèê");
-    assert_eq!("\r\n\t".escape_debug().to_string(), "\\r\\n\\t");
+    assert_eq!("\0\r\n\t".escape_debug().to_string(), "\\0\\r\\n\\t");
     assert_eq!("'\"\\".escape_debug().to_string(), "\\'\\\"\\\\");
     assert_eq!("\u{7f}\u{ff}".escape_debug().to_string(), "\\u{7f}\u{ff}");
     assert_eq!("\u{100}\u{ffff}".escape_debug().to_string(), "\u{100}\\u{ffff}");