Skip to content

Commit e6f387d

Browse files
committed
test(script): Update from rustc's test suite
Update to bc1d7273dfbc6f8a11c0086fa35f6748a13e8d3c
1 parent 8120df7 commit e6f387d

File tree

66 files changed

+255
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+255
-129
lines changed

tests/testsuite/script/rustc.rs

Lines changed: 125 additions & 101 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
-
3+
---
4+
1
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
extern crate proc_macro;
2-
use proc_macro::TokenStream;
2+
use proc_macro::{Literal, TokenStream};
33

44
#[proc_macro]
55
pub fn check(_: TokenStream) -> TokenStream {
6+
// In the following test cases, the `---` may look like the start of frontmatter but it is not!
7+
// That's because it would be backward incompatible to interpret them as such in the latest
8+
// stable edition. That's not only the case due to the feature gate error but also due to the
9+
// fact that we "eagerly" emit errors on malformed frontmatter.
10+
11+
// issue: <https://github.com/rust-lang/rust/issues/145520>
12+
_ = "---".parse::<TokenStream>();
13+
// Just a sequence of regular Rust punctuation tokens.
614
assert_eq!(6, "---\n---".parse::<TokenStream>().unwrap().into_iter().count());
15+
16+
// issue: <https://github.com/rust-lang/rust/issues/146132>
17+
assert!("---".parse::<Literal>().is_err());
18+
719
Default::default()
820
}

tests/testsuite/script/rustc_fixtures/frontmatter-contains-whitespace.rs renamed to tests/testsuite/script/rustc_fixtures/content-contains-whitespace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
---cargo
33
# Beware editing: it has numerous whitespace characters which are important.
44
# It contains one ranges from the 'PATTERN_WHITE_SPACE' property outlined in
5-
# https: //unicode.org/Public/UNIDATA/PropList.txt
5+
# https://unicode.org/Public/UNIDATA/PropList.txt
66
#
77
# The characters in the first expression of the assertion can be generated
88
# from: "4\u{0C}+\n\t\r7\t*\u{20}2\u{85}/\u{200E}3\u{200F}*\u{2028}2\u{2029}"

tests/testsuite/script/rustc_fixtures/frontmatter-non-lexible-tokens.rs renamed to tests/testsuite/script/rustc_fixtures/content-non-lexible-tokens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---cargo
1+
--- cargo
22
package.description = """
33
🏳️‍⚧️
44
"""

tests/testsuite/script/rustc_fixtures/escape.rs renamed to tests/testsuite/script/rustc_fixtures/escape-hyphens-leading.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package.description = """
44
---
55

66
"""
7-
87
----
98

109
//@ check-pass

0 commit comments

Comments
 (0)