about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/unicode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/unicode.rs')
-rw-r--r--src/tools/clippy/tests/ui/unicode.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/unicode.rs b/src/tools/clippy/tests/ui/unicode.rs
new file mode 100644
index 00000000000..27db9594f3b
--- /dev/null
+++ b/src/tools/clippy/tests/ui/unicode.rs
@@ -0,0 +1,23 @@
+#[warn(clippy::zero_width_space)]
+fn zero() {
+    print!("Here >​< is a ZWS, and ​another");
+    print!("This\u{200B}is\u{200B}fine");
+}
+
+#[warn(clippy::unicode_not_nfc)]
+fn canon() {
+    print!("̀àh?");
+    print!("a\u{0300}h?"); // also ok
+}
+
+#[warn(clippy::non_ascii_literal)]
+fn uni() {
+    print!("Üben!");
+    print!("\u{DC}ben!"); // this is ok
+}
+
+fn main() {
+    zero();
+    uni();
+    canon();
+}