From 671bc7f32fd150f04793d8d5dbe806e9d4cfe669 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Tue, 30 Nov 2021 13:54:29 +0100 Subject: Fix tests for new error messages in Rust nightly --- testing/tests/ui.rs | 18 ++++++++++++++---- testing/tests/ui/1.54_to_1.57/incorrect_path.rs | 1 + testing/tests/ui/1.54_to_1.57/incorrect_path.stderr | 7 +++++++ testing/tests/ui/before_1.54/incorrect_path.rs | 8 ++++++++ testing/tests/ui/before_1.54/incorrect_path.stderr | 7 +++++++ testing/tests/ui/before_1.58/break_outside_of_loop.rs | 11 +++++++++++ .../tests/ui/before_1.58/break_outside_of_loop.stderr | 8 ++++++++ testing/tests/ui/before_1.58/typo_in_keyword.rs | 11 +++++++++++ testing/tests/ui/before_1.58/typo_in_keyword.stderr | 8 ++++++++ testing/tests/ui/before_1_54/incorrect_path.rs | 8 -------- testing/tests/ui/before_1_54/incorrect_path.stderr | 7 ------- testing/tests/ui/break_outside_of_loop.rs | 11 ----------- testing/tests/ui/break_outside_of_loop.stderr | 8 -------- testing/tests/ui/since_1.58/break_outside_of_loop.rs | 1 + .../tests/ui/since_1.58/break_outside_of_loop.stderr | 8 ++++++++ testing/tests/ui/since_1.58/incorrect_path.rs | 1 + testing/tests/ui/since_1.58/incorrect_path.stderr | 7 +++++++ testing/tests/ui/since_1.58/typo_in_keyword.rs | 1 + testing/tests/ui/since_1.58/typo_in_keyword.stderr | 8 ++++++++ testing/tests/ui/since_1_54/incorrect_path.rs | 1 - testing/tests/ui/since_1_54/incorrect_path.stderr | 7 ------- testing/tests/ui/typo_in_keyword.rs | 11 ----------- testing/tests/ui/typo_in_keyword.stderr | 8 -------- 23 files changed, 101 insertions(+), 65 deletions(-) create mode 120000 testing/tests/ui/1.54_to_1.57/incorrect_path.rs create mode 100644 testing/tests/ui/1.54_to_1.57/incorrect_path.stderr create mode 100644 testing/tests/ui/before_1.54/incorrect_path.rs create mode 100644 testing/tests/ui/before_1.54/incorrect_path.stderr create mode 100644 testing/tests/ui/before_1.58/break_outside_of_loop.rs create mode 100644 testing/tests/ui/before_1.58/break_outside_of_loop.stderr create mode 100644 testing/tests/ui/before_1.58/typo_in_keyword.rs create mode 100644 testing/tests/ui/before_1.58/typo_in_keyword.stderr delete mode 100644 testing/tests/ui/before_1_54/incorrect_path.rs delete mode 100644 testing/tests/ui/before_1_54/incorrect_path.stderr delete mode 100644 testing/tests/ui/break_outside_of_loop.rs delete mode 100644 testing/tests/ui/break_outside_of_loop.stderr create mode 120000 testing/tests/ui/since_1.58/break_outside_of_loop.rs create mode 100644 testing/tests/ui/since_1.58/break_outside_of_loop.stderr create mode 120000 testing/tests/ui/since_1.58/incorrect_path.rs create mode 100644 testing/tests/ui/since_1.58/incorrect_path.stderr create mode 120000 testing/tests/ui/since_1.58/typo_in_keyword.rs create mode 100644 testing/tests/ui/since_1.58/typo_in_keyword.stderr delete mode 120000 testing/tests/ui/since_1_54/incorrect_path.rs delete mode 100644 testing/tests/ui/since_1_54/incorrect_path.stderr delete mode 100644 testing/tests/ui/typo_in_keyword.rs delete mode 100644 testing/tests/ui/typo_in_keyword.stderr (limited to 'testing/tests') diff --git a/testing/tests/ui.rs b/testing/tests/ui.rs index 39a0b78..33848b2 100644 --- a/testing/tests/ui.rs +++ b/testing/tests/ui.rs @@ -6,9 +6,19 @@ fn ui() { let t = TestCases::new(); t.compile_fail("tests/ui/*.rs"); - if rustc::is_min_version("1.54").unwrap() { - t.compile_fail("tests/ui/since_1_54/*.rs"); - } else { - t.compile_fail("tests/ui/before_1_54/*.rs"); + if rustc::is_min_version("1.58").unwrap() { + t.compile_fail("tests/ui/since_1.58/*.rs"); + } + + if rustc::is_max_version("1.57").unwrap() { + t.compile_fail("tests/ui/before_1.58/*.rs"); + } + + if rustc::is_min_version("1.54").unwrap() && rustc::is_max_version("1.57").unwrap() { + t.compile_fail("tests/ui/1.54_to_1.57/*.rs"); + } + + if rustc::is_max_version("1.53").unwrap() { + t.compile_fail("tests/ui/before_1.54/*.rs"); } } diff --git a/testing/tests/ui/1.54_to_1.57/incorrect_path.rs b/testing/tests/ui/1.54_to_1.57/incorrect_path.rs new file mode 120000 index 0000000..ee3ef39 --- /dev/null +++ b/testing/tests/ui/1.54_to_1.57/incorrect_path.rs @@ -0,0 +1 @@ +../before_1.54/incorrect_path.rs \ No newline at end of file diff --git a/testing/tests/ui/1.54_to_1.57/incorrect_path.stderr b/testing/tests/ui/1.54_to_1.57/incorrect_path.stderr new file mode 100644 index 0000000..e3d7ca4 --- /dev/null +++ b/testing/tests/ui/1.54_to_1.57/incorrect_path.stderr @@ -0,0 +1,7 @@ +error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/askama_testing/templates"] + --> $DIR/incorrect_path.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/before_1.54/incorrect_path.rs b/testing/tests/ui/before_1.54/incorrect_path.rs new file mode 100644 index 0000000..f0c85cf --- /dev/null +++ b/testing/tests/ui/before_1.54/incorrect_path.rs @@ -0,0 +1,8 @@ +use askama::Template; + +#[derive(Template)] +#[template(path = "thisdoesnotexist.html")] +struct MyTemplate; + +fn main() { +} diff --git a/testing/tests/ui/before_1.54/incorrect_path.stderr b/testing/tests/ui/before_1.54/incorrect_path.stderr new file mode 100644 index 0000000..ea97149 --- /dev/null +++ b/testing/tests/ui/before_1.54/incorrect_path.stderr @@ -0,0 +1,7 @@ +error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/askama_testing/templates"] + --> $DIR/incorrect_path.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/before_1.58/break_outside_of_loop.rs b/testing/tests/ui/before_1.58/break_outside_of_loop.rs new file mode 100644 index 0000000..ccbb0a9 --- /dev/null +++ b/testing/tests/ui/before_1.58/break_outside_of_loop.rs @@ -0,0 +1,11 @@ +use askama::Template; + +#[derive(Template)] +#[template( + source = "Have a {%break%}, have a parsing error!", + ext = "txt" +)] +struct MyTemplate; + +fn main() { +} diff --git a/testing/tests/ui/before_1.58/break_outside_of_loop.stderr b/testing/tests/ui/before_1.58/break_outside_of_loop.stderr new file mode 100644 index 0000000..99d1d25 --- /dev/null +++ b/testing/tests/ui/before_1.58/break_outside_of_loop.stderr @@ -0,0 +1,8 @@ +error: problems parsing template source at row 1, column 9 near: +"break%}, have a parsing error!" + --> $DIR/break_outside_of_loop.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/before_1.58/typo_in_keyword.rs b/testing/tests/ui/before_1.58/typo_in_keyword.rs new file mode 100644 index 0000000..acbf5d7 --- /dev/null +++ b/testing/tests/ui/before_1.58/typo_in_keyword.rs @@ -0,0 +1,11 @@ +use askama::Template; + +#[derive(Template)] +#[template( + source = "{%for i in 1..=10%}{{i}}{%endfo%}\n1234567890123456789012345678901234567890", + ext = "txt" +)] +struct MyTemplate; + +fn main() { +} diff --git a/testing/tests/ui/before_1.58/typo_in_keyword.stderr b/testing/tests/ui/before_1.58/typo_in_keyword.stderr new file mode 100644 index 0000000..545476e --- /dev/null +++ b/testing/tests/ui/before_1.58/typo_in_keyword.stderr @@ -0,0 +1,8 @@ +error: problems parsing template source at row 1, column 26 near: +"endfo%}\n12345678901234567890123456789012"... + --> $DIR/typo_in_keyword.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/before_1_54/incorrect_path.rs b/testing/tests/ui/before_1_54/incorrect_path.rs deleted file mode 100644 index f0c85cf..0000000 --- a/testing/tests/ui/before_1_54/incorrect_path.rs +++ /dev/null @@ -1,8 +0,0 @@ -use askama::Template; - -#[derive(Template)] -#[template(path = "thisdoesnotexist.html")] -struct MyTemplate; - -fn main() { -} diff --git a/testing/tests/ui/before_1_54/incorrect_path.stderr b/testing/tests/ui/before_1_54/incorrect_path.stderr deleted file mode 100644 index ea97149..0000000 --- a/testing/tests/ui/before_1_54/incorrect_path.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/askama_testing/templates"] - --> $DIR/incorrect_path.rs:3:10 - | -3 | #[derive(Template)] - | ^^^^^^^^ - | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/break_outside_of_loop.rs b/testing/tests/ui/break_outside_of_loop.rs deleted file mode 100644 index ccbb0a9..0000000 --- a/testing/tests/ui/break_outside_of_loop.rs +++ /dev/null @@ -1,11 +0,0 @@ -use askama::Template; - -#[derive(Template)] -#[template( - source = "Have a {%break%}, have a parsing error!", - ext = "txt" -)] -struct MyTemplate; - -fn main() { -} diff --git a/testing/tests/ui/break_outside_of_loop.stderr b/testing/tests/ui/break_outside_of_loop.stderr deleted file mode 100644 index 99d1d25..0000000 --- a/testing/tests/ui/break_outside_of_loop.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: problems parsing template source at row 1, column 9 near: -"break%}, have a parsing error!" - --> $DIR/break_outside_of_loop.rs:3:10 - | -3 | #[derive(Template)] - | ^^^^^^^^ - | - = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/since_1.58/break_outside_of_loop.rs b/testing/tests/ui/since_1.58/break_outside_of_loop.rs new file mode 120000 index 0000000..ae7115e --- /dev/null +++ b/testing/tests/ui/since_1.58/break_outside_of_loop.rs @@ -0,0 +1 @@ +../before_1.58/break_outside_of_loop.rs \ No newline at end of file diff --git a/testing/tests/ui/since_1.58/break_outside_of_loop.stderr b/testing/tests/ui/since_1.58/break_outside_of_loop.stderr new file mode 100644 index 0000000..8f6ba68 --- /dev/null +++ b/testing/tests/ui/since_1.58/break_outside_of_loop.stderr @@ -0,0 +1,8 @@ +error: problems parsing template source at row 1, column 9 near: + "break%}, have a parsing error!" + --> tests/ui/since_1.58/break_outside_of_loop.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/since_1.58/incorrect_path.rs b/testing/tests/ui/since_1.58/incorrect_path.rs new file mode 120000 index 0000000..ee3ef39 --- /dev/null +++ b/testing/tests/ui/since_1.58/incorrect_path.rs @@ -0,0 +1 @@ +../before_1.54/incorrect_path.rs \ No newline at end of file diff --git a/testing/tests/ui/since_1.58/incorrect_path.stderr b/testing/tests/ui/since_1.58/incorrect_path.stderr new file mode 100644 index 0000000..7581a91 --- /dev/null +++ b/testing/tests/ui/since_1.58/incorrect_path.stderr @@ -0,0 +1,7 @@ +error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/askama_testing/templates"] + --> tests/ui/since_1.58/incorrect_path.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/since_1.58/typo_in_keyword.rs b/testing/tests/ui/since_1.58/typo_in_keyword.rs new file mode 120000 index 0000000..927f556 --- /dev/null +++ b/testing/tests/ui/since_1.58/typo_in_keyword.rs @@ -0,0 +1 @@ +../before_1.58/typo_in_keyword.rs \ No newline at end of file diff --git a/testing/tests/ui/since_1.58/typo_in_keyword.stderr b/testing/tests/ui/since_1.58/typo_in_keyword.stderr new file mode 100644 index 0000000..92c638d --- /dev/null +++ b/testing/tests/ui/since_1.58/typo_in_keyword.stderr @@ -0,0 +1,8 @@ +error: problems parsing template source at row 1, column 26 near: + "endfo%}\n12345678901234567890123456789012"... + --> tests/ui/since_1.58/typo_in_keyword.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/since_1_54/incorrect_path.rs b/testing/tests/ui/since_1_54/incorrect_path.rs deleted file mode 120000 index 224f517..0000000 --- a/testing/tests/ui/since_1_54/incorrect_path.rs +++ /dev/null @@ -1 +0,0 @@ -../before_1_54/incorrect_path.rs \ No newline at end of file diff --git a/testing/tests/ui/since_1_54/incorrect_path.stderr b/testing/tests/ui/since_1_54/incorrect_path.stderr deleted file mode 100644 index e3d7ca4..0000000 --- a/testing/tests/ui/since_1_54/incorrect_path.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/askama_testing/templates"] - --> $DIR/incorrect_path.rs:3:10 - | -3 | #[derive(Template)] - | ^^^^^^^^ - | - = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/testing/tests/ui/typo_in_keyword.rs b/testing/tests/ui/typo_in_keyword.rs deleted file mode 100644 index acbf5d7..0000000 --- a/testing/tests/ui/typo_in_keyword.rs +++ /dev/null @@ -1,11 +0,0 @@ -use askama::Template; - -#[derive(Template)] -#[template( - source = "{%for i in 1..=10%}{{i}}{%endfo%}\n1234567890123456789012345678901234567890", - ext = "txt" -)] -struct MyTemplate; - -fn main() { -} diff --git a/testing/tests/ui/typo_in_keyword.stderr b/testing/tests/ui/typo_in_keyword.stderr deleted file mode 100644 index 545476e..0000000 --- a/testing/tests/ui/typo_in_keyword.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: problems parsing template source at row 1, column 26 near: -"endfo%}\n12345678901234567890123456789012"... - --> $DIR/typo_in_keyword.rs:3:10 - | -3 | #[derive(Template)] - | ^^^^^^^^ - | - = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) -- cgit