about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/.gitattributes1
-rw-r--r--tests/ui/frontmatter/frontmatter-contains-whitespace.rs22
-rw-r--r--tests/ui/frontmatter/frontmatter-crlf.rs14
-rw-r--r--tests/ui/frontmatter/frontmatter-whitespace-3.rs5
-rw-r--r--tests/ui/frontmatter/frontmatter-whitespace-4.rs3
5 files changed, 42 insertions, 3 deletions
diff --git a/tests/ui/.gitattributes b/tests/ui/.gitattributes
index 9ea3d3fb0e1..4923ac100e1 100644
--- a/tests/ui/.gitattributes
+++ b/tests/ui/.gitattributes
@@ -3,4 +3,5 @@ json-bom-plus-crlf.rs -text
 json-bom-plus-crlf-multifile.rs -text
 json-bom-plus-crlf-multifile-aux.rs -text
 trailing-carriage-return-in-string.rs -text
+frontmatter-crlf.rs -text
 *.bin -text
diff --git a/tests/ui/frontmatter/frontmatter-contains-whitespace.rs b/tests/ui/frontmatter/frontmatter-contains-whitespace.rs
new file mode 100644
index 00000000000..11df822f793
--- /dev/null
+++ b/tests/ui/frontmatter/frontmatter-contains-whitespace.rs
@@ -0,0 +1,22 @@
+#!/usr/bin/env -S cargo -Zscript
+---cargo
+# Beware editing: it has numerous whitespace characters which are important.
+# It contains one ranges from the 'PATTERN_WHITE_SPACE' property outlined in
+# https://unicode.org/Public/UNIDATA/PropList.txt
+#
+# The characters in the first expression of the assertion can be generated
+# from: "4\u{0C}+\n\t\r7\t*\u{20}2\u{85}/\u{200E}3\u{200F}*\u{2028}2\u{2029}"
+package.description = """
+4+
+
+7   * 2…/‎3‏*
2
+"""
+---
+
+//@ check-pass
+
+// Ensure the frontmatter can contain any whitespace
+
+#![feature(frontmatter)]
+
+fn main() {}
diff --git a/tests/ui/frontmatter/frontmatter-crlf.rs b/tests/ui/frontmatter/frontmatter-crlf.rs
new file mode 100644
index 00000000000..b46cc9ddbb0
--- /dev/null
+++ b/tests/ui/frontmatter/frontmatter-crlf.rs
@@ -0,0 +1,14 @@
+#!/usr/bin/env -S cargo -Zscript

+---

+[dependencies]

+clap = "4"

+---

+

+//@ check-pass

+// ignore-tidy-cr

+

+// crlf line endings should be accepted

+

+#![feature(frontmatter)]

+

+fn main() {}

diff --git a/tests/ui/frontmatter/frontmatter-whitespace-3.rs b/tests/ui/frontmatter/frontmatter-whitespace-3.rs
index 95e0981e2ae..6580514fba2 100644
--- a/tests/ui/frontmatter/frontmatter-whitespace-3.rs
+++ b/tests/ui/frontmatter/frontmatter-whitespace-3.rs
@@ -1,7 +1,7 @@
 
 
----cargo   
----   
+---cargo   	
+---   	
 
 // please note the whitespace characters after the first four lines.
 // This ensures that we accept whitespaces before the frontmatter, after
@@ -10,6 +10,7 @@
 //@ check-pass
 // ignore-tidy-end-whitespace
 // ignore-tidy-leading-newlines
+// ignore-tidy-tab
 
 #![feature(frontmatter)]
 
diff --git a/tests/ui/frontmatter/frontmatter-whitespace-4.rs b/tests/ui/frontmatter/frontmatter-whitespace-4.rs
index 3bda3227838..1e7c5556647 100644
--- a/tests/ui/frontmatter/frontmatter-whitespace-4.rs
+++ b/tests/ui/frontmatter/frontmatter-whitespace-4.rs
@@ -1,7 +1,8 @@
---- cargo
+--- 	cargo
 ---
 
 //@ check-pass
+// ignore-tidy-tab
 // A frontmatter infostring can have leading whitespace.
 
 #![feature(frontmatter)]