From 59dd03bc39c88181d75f68cf9193a7696e00edee Mon Sep 17 00:00:00 2001 From: piegames Date: Tue, 24 Jun 2025 17:20:18 +0200 Subject: [PATCH] tests/functional2/lang: Migrate undefined-var tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The second test has also been fixed. I'd do it in two commits if functional1 wasn't such a PITA (guess why we're doing the migration …). Basically, the introduced syntax got changed later on, but the test never got updated, and back then tests didn't test the output so nobody ever noticed it now failing for a wrong reason. Change-Id: I5b66127d507c65676b8dd4a82d1e1f2857fef145 --- tests/functional/lang/parse-fail-undef-var-2.err.exp | 6 ------ tests/functional/lang/parse-fail-undef-var-2.nix | 6 ------ tests/functional2/lang/undefined-var/in-2.nix | 6 ++++++ .../lang/undefined-var/in.nix} | 0 tests/functional2/lang/undefined-var/parse-fail-2.err.exp | 6 ++++++ .../lang/undefined-var/parse-fail.err.exp} | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 tests/functional/lang/parse-fail-undef-var-2.err.exp delete mode 100644 tests/functional/lang/parse-fail-undef-var-2.nix create mode 100644 tests/functional2/lang/undefined-var/in-2.nix rename tests/{functional/lang/parse-fail-undef-var.nix => functional2/lang/undefined-var/in.nix} (100%) create mode 100644 tests/functional2/lang/undefined-var/parse-fail-2.err.exp rename tests/{functional/lang/parse-fail-undef-var.err.exp => functional2/lang/undefined-var/parse-fail.err.exp} (65%) diff --git a/tests/functional/lang/parse-fail-undef-var-2.err.exp b/tests/functional/lang/parse-fail-undef-var-2.err.exp deleted file mode 100644 index 036d0f1f7..000000000 --- a/tests/functional/lang/parse-fail-undef-var-2.err.exp +++ /dev/null @@ -1,6 +0,0 @@ -error: syntax error, expecting '}' - at /pwd/parse-fail-undef-var-2.nix:3:13: - 2| - 3| f = {x, y : ["baz" "bar" z "bat"]}: x + y; - | ^ - 4| diff --git a/tests/functional/lang/parse-fail-undef-var-2.nix b/tests/functional/lang/parse-fail-undef-var-2.nix deleted file mode 100644 index c2e959495..000000000 --- a/tests/functional/lang/parse-fail-undef-var-2.nix +++ /dev/null @@ -1,6 +0,0 @@ -let - - f = {x, y : ["baz" "bar" z "bat"]}: x + y; - -in -f {x = "foo"; y = "bar";} diff --git a/tests/functional2/lang/undefined-var/in-2.nix b/tests/functional2/lang/undefined-var/in-2.nix new file mode 100644 index 000000000..5add9f888 --- /dev/null +++ b/tests/functional2/lang/undefined-var/in-2.nix @@ -0,0 +1,6 @@ +let + + f = {x, y ? ["baz" "bar" z "bat"]}: x + y; + +in +f {x = "foo"; y = "bar";} diff --git a/tests/functional/lang/parse-fail-undef-var.nix b/tests/functional2/lang/undefined-var/in.nix similarity index 100% rename from tests/functional/lang/parse-fail-undef-var.nix rename to tests/functional2/lang/undefined-var/in.nix diff --git a/tests/functional2/lang/undefined-var/parse-fail-2.err.exp b/tests/functional2/lang/undefined-var/parse-fail-2.err.exp new file mode 100644 index 000000000..7bd4f9ad2 --- /dev/null +++ b/tests/functional2/lang/undefined-var/parse-fail-2.err.exp @@ -0,0 +1,6 @@ +error: undefined variable 'z' + at /pwd/in.nix:3:28: + 2| + 3| f = {x, y ? ["baz" "bar" z "bat"]}: x + y; + | ^ + 4| diff --git a/tests/functional/lang/parse-fail-undef-var.err.exp b/tests/functional2/lang/undefined-var/parse-fail.err.exp similarity index 65% rename from tests/functional/lang/parse-fail-undef-var.err.exp rename to tests/functional2/lang/undefined-var/parse-fail.err.exp index 38b8fd5cb..bf10ce375 100644 --- a/tests/functional/lang/parse-fail-undef-var.err.exp +++ b/tests/functional2/lang/undefined-var/parse-fail.err.exp @@ -1,5 +1,5 @@ error: undefined variable 'y' - at /pwd/parse-fail-undef-var.nix:1:4: + at /pwd/in.nix:1:4: 1| x: y | ^ 2|