summaryrefslogtreecommitdiffstats
path: root/src/test/ui/fmt/unicode-escape-spans.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/fmt/unicode-escape-spans.rs')
-rw-r--r--src/test/ui/fmt/unicode-escape-spans.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/fmt/unicode-escape-spans.rs b/src/test/ui/fmt/unicode-escape-spans.rs
new file mode 100644
index 000000000..753d91ce5
--- /dev/null
+++ b/src/test/ui/fmt/unicode-escape-spans.rs
@@ -0,0 +1,19 @@
+fn main() {
+ // 1 byte in UTF-8
+ format!("\u{000041}{a}"); //~ ERROR cannot find value
+ format!("\u{0041}{a}"); //~ ERROR cannot find value
+ format!("\u{41}{a}"); //~ ERROR cannot find value
+ format!("\u{0}{a}"); //~ ERROR cannot find value
+
+ // 2 bytes
+ format!("\u{0df}{a}"); //~ ERROR cannot find value
+ format!("\u{df}{a}"); //~ ERROR cannot find value
+
+ // 3 bytes
+ format!("\u{00211d}{a}"); //~ ERROR cannot find value
+ format!("\u{211d}{a}"); //~ ERROR cannot find value
+
+ // 4 bytes
+ format!("\u{1f4a3}{a}"); //~ ERROR cannot find value
+ format!("\u{10ffff}{a}"); //~ ERROR cannot find value
+}