]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/proc-macro/auxiliary/api/parse.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / proc-macro / auxiliary / api / parse.rs
index 6186b941ef69f6c6f5fee030212c203c3aa6ed8e..27391f8311176cdb17fdac88f274734228a87a2a 100644 (file)
@@ -18,6 +18,17 @@ fn test_display_literal() {
         Literal::f64_unsuffixed(1e100).to_string(),
         "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0",
     );
+
+    assert_eq!(
+        Literal::string("a \t ❤ ' \" \u{1}").to_string(),
+        "\"a \\t ❤ ' \\\" \\u{1}\"",
+    );
+    assert_eq!(Literal::character('a').to_string(), "'a'");
+    assert_eq!(Literal::character('\t').to_string(), "'\\t'");
+    assert_eq!(Literal::character('❤').to_string(), "'❤'");
+    assert_eq!(Literal::character('\'').to_string(), "'\\''");
+    assert_eq!(Literal::character('"').to_string(), "'\"'");
+    assert_eq!(Literal::character('\u{1}').to_string(), "'\\u{1}'");
 }
 
 fn test_parse_literal() {