about summary refs log tree commit diff
path: root/compiler/rustc_parse_format/src/tests.rs
diff options
context:
space:
mode:
authorMarijn Schouten <mhkbst@gmail.com>2025-01-23 10:16:08 +0100
committerMarijn Schouten <mhkbst@gmail.com>2025-01-28 19:33:00 +0100
commit3026545ab50e65fcd1c888b77272032000e36147 (patch)
tree83d8f76cf48fb5dff5b2e1bf6de953a0c639be24 /compiler/rustc_parse_format/src/tests.rs
parentfdd1a3b02687817cea41f6bacae3d5fbed2b2cd0 (diff)
downloadrust-3026545ab50e65fcd1c888b77272032000e36147.tar.gz
rust-3026545ab50e65fcd1c888b77272032000e36147.zip
parse_format optimize import use
Diffstat (limited to 'compiler/rustc_parse_format/src/tests.rs')
-rw-r--r--compiler/rustc_parse_format/src/tests.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/rustc_parse_format/src/tests.rs b/compiler/rustc_parse_format/src/tests.rs
index 81e5bca0ba9..fbb217b16fc 100644
--- a/compiler/rustc_parse_format/src/tests.rs
+++ b/compiler/rustc_parse_format/src/tests.rs
@@ -1,3 +1,5 @@
+use Piece::*;
+
 use super::*;
 
 #[track_caller]
@@ -32,12 +34,12 @@ fn musterr(s: &str) {
 
 #[test]
 fn simple() {
-    same("asdf", &[String("asdf")]);
-    same("a{{b", &[String("a"), String("{b")]);
-    same("a}}b", &[String("a"), String("}b")]);
-    same("a}}", &[String("a"), String("}")]);
-    same("}}", &[String("}")]);
-    same("\\}}", &[String("\\"), String("}")]);
+    same("asdf", &[Lit("asdf")]);
+    same("a{{b", &[Lit("a"), Lit("{b")]);
+    same("a}}b", &[Lit("a"), Lit("}b")]);
+    same("a}}", &[Lit("a"), Lit("}")]);
+    same("}}", &[Lit("}")]);
+    same("\\}}", &[Lit("\\"), Lit("}")]);
 }
 
 #[test]
@@ -370,7 +372,7 @@ fn format_flags() {
 #[test]
 fn format_mixture() {
     same("abcd {3:x} efg", &[
-        String("abcd "),
+        Lit("abcd "),
         NextArgument(Box::new(Argument {
             position: ArgumentIs(3),
             position_span: InnerSpan { start: 7, end: 8 },
@@ -390,7 +392,7 @@ fn format_mixture() {
                 ty_span: None,
             },
         })),
-        String(" efg"),
+        Lit(" efg"),
     ]);
 }
 #[test]