From 5f7e032d2850c9ecd4c79b80b674e27047092fd3 Mon Sep 17 00:00:00 2001 From: piegames Date: Tue, 24 Jun 2025 17:51:38 +0200 Subject: [PATCH] tests/functional2/lang: Migrate eol tests Also slightly refactor the existing crlf test to better fit in Change-Id: Ib4dfa4b3318b3dd55a12d99a9f4908cdf1bce08b --- tests/functional/lang/parse-fail-eol-2.flags | 1 - tests/functional/lang/parse-fail-eol-3.flags | 1 - .../lang/line-endings-crlf/in-eol-1.nix} | 0 .../lang/line-endings-crlf/in-eol-2.nix} | 0 .../lang/line-endings-crlf/in-eol-3.nix} | 0 .../{line_endings => line-endings-crlf}/in.nix | 0 .../parse-fail-crlf.err.exp} | 0 .../line-endings-crlf}/parse-fail-eol-1.err.exp | 2 +- .../line-endings-crlf}/parse-fail-eol-2.err.exp | 2 +- .../line-endings-crlf}/parse-fail-eol-3.err.exp | 2 +- .../parse-okay-with-warning.out.exp} | 0 tests/functional2/lang/line-endings-crlf/test.toml | 14 ++++++++++++++ tests/functional2/lang/line_endings/test.toml | 8 -------- 13 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 tests/functional/lang/parse-fail-eol-2.flags delete mode 100644 tests/functional/lang/parse-fail-eol-3.flags rename tests/{functional/lang/parse-fail-eol-1.nix => functional2/lang/line-endings-crlf/in-eol-1.nix} (100%) rename tests/{functional/lang/parse-fail-eol-2.nix => functional2/lang/line-endings-crlf/in-eol-2.nix} (100%) rename tests/{functional/lang/parse-fail-eol-3.nix => functional2/lang/line-endings-crlf/in-eol-3.nix} (100%) rename tests/functional2/lang/{line_endings => line-endings-crlf}/in.nix (100%) rename tests/functional2/lang/{line_endings/depr.err.exp => line-endings-crlf/parse-fail-crlf.err.exp} (100%) rename tests/{functional/lang => functional2/lang/line-endings-crlf}/parse-fail-eol-1.err.exp (74%) rename tests/{functional/lang => functional2/lang/line-endings-crlf}/parse-fail-eol-2.err.exp (74%) rename tests/{functional/lang => functional2/lang/line-endings-crlf}/parse-fail-eol-3.err.exp (74%) rename tests/functional2/lang/{line_endings/allow-depr.out.exp => line-endings-crlf/parse-okay-with-warning.out.exp} (100%) create mode 100644 tests/functional2/lang/line-endings-crlf/test.toml delete mode 100644 tests/functional2/lang/line_endings/test.toml diff --git a/tests/functional/lang/parse-fail-eol-2.flags b/tests/functional/lang/parse-fail-eol-2.flags deleted file mode 100644 index a7c7a5cbe..000000000 --- a/tests/functional/lang/parse-fail-eol-2.flags +++ /dev/null @@ -1 +0,0 @@ ---extra-deprecated-features cr-line-endings diff --git a/tests/functional/lang/parse-fail-eol-3.flags b/tests/functional/lang/parse-fail-eol-3.flags deleted file mode 100644 index a7c7a5cbe..000000000 --- a/tests/functional/lang/parse-fail-eol-3.flags +++ /dev/null @@ -1 +0,0 @@ ---extra-deprecated-features cr-line-endings diff --git a/tests/functional/lang/parse-fail-eol-1.nix b/tests/functional2/lang/line-endings-crlf/in-eol-1.nix similarity index 100% rename from tests/functional/lang/parse-fail-eol-1.nix rename to tests/functional2/lang/line-endings-crlf/in-eol-1.nix diff --git a/tests/functional/lang/parse-fail-eol-2.nix b/tests/functional2/lang/line-endings-crlf/in-eol-2.nix similarity index 100% rename from tests/functional/lang/parse-fail-eol-2.nix rename to tests/functional2/lang/line-endings-crlf/in-eol-2.nix diff --git a/tests/functional/lang/parse-fail-eol-3.nix b/tests/functional2/lang/line-endings-crlf/in-eol-3.nix similarity index 100% rename from tests/functional/lang/parse-fail-eol-3.nix rename to tests/functional2/lang/line-endings-crlf/in-eol-3.nix diff --git a/tests/functional2/lang/line_endings/in.nix b/tests/functional2/lang/line-endings-crlf/in.nix similarity index 100% rename from tests/functional2/lang/line_endings/in.nix rename to tests/functional2/lang/line-endings-crlf/in.nix diff --git a/tests/functional2/lang/line_endings/depr.err.exp b/tests/functional2/lang/line-endings-crlf/parse-fail-crlf.err.exp similarity index 100% rename from tests/functional2/lang/line_endings/depr.err.exp rename to tests/functional2/lang/line-endings-crlf/parse-fail-crlf.err.exp diff --git a/tests/functional/lang/parse-fail-eol-1.err.exp b/tests/functional2/lang/line-endings-crlf/parse-fail-eol-1.err.exp similarity index 74% rename from tests/functional/lang/parse-fail-eol-1.err.exp rename to tests/functional2/lang/line-endings-crlf/parse-fail-eol-1.err.exp index f500c357b..7f8a3b4f5 100644 --- a/tests/functional/lang/parse-fail-eol-1.err.exp +++ b/tests/functional2/lang/line-endings-crlf/parse-fail-eol-1.err.exp @@ -1,5 +1,5 @@ error: undefined variable 'invalid' - at /pwd/parse-fail-eol-1.nix:2:1: + at /pwd/in.nix:2:1: 1| # foo 2| invalid | ^ diff --git a/tests/functional/lang/parse-fail-eol-2.err.exp b/tests/functional2/lang/line-endings-crlf/parse-fail-eol-2.err.exp similarity index 74% rename from tests/functional/lang/parse-fail-eol-2.err.exp rename to tests/functional2/lang/line-endings-crlf/parse-fail-eol-2.err.exp index 053865db2..7f8a3b4f5 100644 --- a/tests/functional/lang/parse-fail-eol-2.err.exp +++ b/tests/functional2/lang/line-endings-crlf/parse-fail-eol-2.err.exp @@ -1,5 +1,5 @@ error: undefined variable 'invalid' - at /pwd/parse-fail-eol-2.nix:2:1: + at /pwd/in.nix:2:1: 1| # foo 2| invalid | ^ diff --git a/tests/functional/lang/parse-fail-eol-3.err.exp b/tests/functional2/lang/line-endings-crlf/parse-fail-eol-3.err.exp similarity index 74% rename from tests/functional/lang/parse-fail-eol-3.err.exp rename to tests/functional2/lang/line-endings-crlf/parse-fail-eol-3.err.exp index 06901baad..7f8a3b4f5 100644 --- a/tests/functional/lang/parse-fail-eol-3.err.exp +++ b/tests/functional2/lang/line-endings-crlf/parse-fail-eol-3.err.exp @@ -1,5 +1,5 @@ error: undefined variable 'invalid' - at /pwd/parse-fail-eol-3.nix:2:1: + at /pwd/in.nix:2:1: 1| # foo 2| invalid | ^ diff --git a/tests/functional2/lang/line_endings/allow-depr.out.exp b/tests/functional2/lang/line-endings-crlf/parse-okay-with-warning.out.exp similarity index 100% rename from tests/functional2/lang/line_endings/allow-depr.out.exp rename to tests/functional2/lang/line-endings-crlf/parse-okay-with-warning.out.exp diff --git a/tests/functional2/lang/line-endings-crlf/test.toml b/tests/functional2/lang/line-endings-crlf/test.toml new file mode 100644 index 000000000..23404e85f --- /dev/null +++ b/tests/functional2/lang/line-endings-crlf/test.toml @@ -0,0 +1,14 @@ +[[test]] +name = "parse-fail-crlf" +runner = "parse-fail" + +[[test]] +name = "parse-okay-with-warning" +runner = "parse-okay" +flags = ["--extra-deprecated-features", "cr-line-endings"] + +[[test]] +runner = "parse-fail" +in = [ "in-eol-1.nix", "in-eol-2.nix", "in-eol-3.nix" ] +matrix = true +flags = ["--extra-deprecated-features", "cr-line-endings"] diff --git a/tests/functional2/lang/line_endings/test.toml b/tests/functional2/lang/line_endings/test.toml deleted file mode 100644 index ca67319d4..000000000 --- a/tests/functional2/lang/line_endings/test.toml +++ /dev/null @@ -1,8 +0,0 @@ -[[test]] -name = "depr" -runner = "parse-fail" - -[[test]] -name = "allow-depr" -runner = "parse-okay" -flags = ["--extra-deprecated-features", "cr-line-endings"]