From fe7a8d5e67c6992626fd685c4b19452a1c044161 Mon Sep 17 00:00:00 2001 From: piegames Date: Wed, 11 Jun 2025 15:03:51 +0200 Subject: [PATCH] tests/functional2/lang: Migrate arithmetic tests Change-Id: I73259875debc053dca46fe34f9f8d10b8486fa4f --- .../lang/eval-okay-arithmetic-override.flags | 1 - .../eval-fail-overflowing-add.err.exp | 2 +- .../eval-fail-overflowing-div.err.exp | 6 +++--- .../eval-fail-overflowing-mul.err.exp | 4 ++-- .../eval-fail-overflowing-sub.err.exp | 2 +- .../lang/arithmetic/eval-okay-override.out.exp} | 0 .../lang/arithmetic/eval-okay.out.exp} | 0 .../lang/arithmetic/in-overflowing-add.nix} | 0 .../lang/arithmetic/in-overflowing-div.nix} | 0 .../lang/arithmetic/in-overflowing-mul.nix} | 0 .../lang/arithmetic/in-overflowing-sub.nix} | 0 .../lang/arithmetic/in-override.nix} | 0 .../lang/arithmetic/in-precedence.nix} | 0 .../lang/arithmetic/in.nix} | 0 .../arithmetic/parse-okay-precedence.out.exp} | 0 tests/functional2/lang/arithmetic/test.toml | 16 ++++++++++++++++ 16 files changed, 23 insertions(+), 8 deletions(-) delete mode 100644 tests/functional/lang/eval-okay-arithmetic-override.flags rename tests/{functional/lang => functional2/lang/arithmetic}/eval-fail-overflowing-add.err.exp (74%) rename tests/{functional/lang => functional2/lang/arithmetic}/eval-fail-overflowing-div.err.exp (80%) rename tests/{functional/lang => functional2/lang/arithmetic}/eval-fail-overflowing-mul.err.exp (77%) rename tests/{functional/lang => functional2/lang/arithmetic}/eval-fail-overflowing-sub.err.exp (79%) rename tests/{functional/lang/eval-okay-arithmetic-override.exp => functional2/lang/arithmetic/eval-okay-override.out.exp} (100%) rename tests/{functional/lang/eval-okay-arithmetic.exp => functional2/lang/arithmetic/eval-okay.out.exp} (100%) rename tests/{functional/lang/eval-fail-overflowing-add.nix => functional2/lang/arithmetic/in-overflowing-add.nix} (100%) rename tests/{functional/lang/eval-fail-overflowing-div.nix => functional2/lang/arithmetic/in-overflowing-div.nix} (100%) rename tests/{functional/lang/eval-fail-overflowing-mul.nix => functional2/lang/arithmetic/in-overflowing-mul.nix} (100%) rename tests/{functional/lang/eval-fail-overflowing-sub.nix => functional2/lang/arithmetic/in-overflowing-sub.nix} (100%) rename tests/{functional/lang/eval-okay-arithmetic-override.nix => functional2/lang/arithmetic/in-override.nix} (100%) rename tests/{functional/lang/parse-okay-arithmetic.nix => functional2/lang/arithmetic/in-precedence.nix} (100%) rename tests/{functional/lang/eval-okay-arithmetic.nix => functional2/lang/arithmetic/in.nix} (100%) rename tests/{functional/lang/parse-okay-arithmetic.exp => functional2/lang/arithmetic/parse-okay-precedence.out.exp} (100%) create mode 100644 tests/functional2/lang/arithmetic/test.toml diff --git a/tests/functional/lang/eval-okay-arithmetic-override.flags b/tests/functional/lang/eval-okay-arithmetic-override.flags deleted file mode 100644 index 31b1cc41d..000000000 --- a/tests/functional/lang/eval-okay-arithmetic-override.flags +++ /dev/null @@ -1 +0,0 @@ ---extra-deprecated-features shadow-internal-symbols diff --git a/tests/functional/lang/eval-fail-overflowing-add.err.exp b/tests/functional2/lang/arithmetic/eval-fail-overflowing-add.err.exp similarity index 74% rename from tests/functional/lang/eval-fail-overflowing-add.err.exp rename to tests/functional2/lang/arithmetic/eval-fail-overflowing-add.err.exp index 1362afa20..e4c57f3dc 100644 --- a/tests/functional/lang/eval-fail-overflowing-add.err.exp +++ b/tests/functional2/lang/arithmetic/eval-fail-overflowing-add.err.exp @@ -1,5 +1,5 @@ error: integer overflow in adding 9223372036854775807 + 1 - at /pwd/eval-fail-overflowing-add.nix:4:8: + at /pwd/in.nix:4:8: 3| b = 1; 4| in a + b | ^ diff --git a/tests/functional/lang/eval-fail-overflowing-div.err.exp b/tests/functional2/lang/arithmetic/eval-fail-overflowing-div.err.exp similarity index 80% rename from tests/functional/lang/eval-fail-overflowing-div.err.exp rename to tests/functional2/lang/arithmetic/eval-fail-overflowing-div.err.exp index 6772b3f3b..bbf835f43 100644 --- a/tests/functional/lang/eval-fail-overflowing-div.err.exp +++ b/tests/functional2/lang/arithmetic/eval-fail-overflowing-div.err.exp @@ -1,20 +1,20 @@ error: … while calling the 'seq' builtin - at /pwd/eval-fail-overflowing-div.nix:7:4: + at /pwd/in.nix:7:4: 6| b = -1; 7| in builtins.seq intMin (builtins.seq b (intMin / b)) | ^ 8| … while calling the 'seq' builtin - at /pwd/eval-fail-overflowing-div.nix:7:25: + at /pwd/in.nix:7:25: 6| b = -1; 7| in builtins.seq intMin (builtins.seq b (intMin / b)) | ^ 8| … while calling the 'div' builtin - at /pwd/eval-fail-overflowing-div.nix:7:48: + at /pwd/in.nix:7:48: 6| b = -1; 7| in builtins.seq intMin (builtins.seq b (intMin / b)) | ^ diff --git a/tests/functional/lang/eval-fail-overflowing-mul.err.exp b/tests/functional2/lang/arithmetic/eval-fail-overflowing-mul.err.exp similarity index 77% rename from tests/functional/lang/eval-fail-overflowing-mul.err.exp rename to tests/functional2/lang/arithmetic/eval-fail-overflowing-mul.err.exp index ad6fe4d27..c9bc05ee0 100644 --- a/tests/functional/lang/eval-fail-overflowing-mul.err.exp +++ b/tests/functional2/lang/arithmetic/eval-fail-overflowing-mul.err.exp @@ -1,13 +1,13 @@ error: … while calling the 'mul' builtin - at /pwd/eval-fail-overflowing-mul.nix:3:10: + at /pwd/in.nix:3:10: 2| a = 4294967297; 3| in a * a * a | ^ 4| … while calling the 'mul' builtin - at /pwd/eval-fail-overflowing-mul.nix:3:6: + at /pwd/in.nix:3:6: 2| a = 4294967297; 3| in a * a * a | ^ diff --git a/tests/functional/lang/eval-fail-overflowing-sub.err.exp b/tests/functional2/lang/arithmetic/eval-fail-overflowing-sub.err.exp similarity index 79% rename from tests/functional/lang/eval-fail-overflowing-sub.err.exp rename to tests/functional2/lang/arithmetic/eval-fail-overflowing-sub.err.exp index 2ab364d54..db659de97 100644 --- a/tests/functional/lang/eval-fail-overflowing-sub.err.exp +++ b/tests/functional2/lang/arithmetic/eval-fail-overflowing-sub.err.exp @@ -1,6 +1,6 @@ error: … while calling the 'sub' builtin - at /pwd/eval-fail-overflowing-sub.nix:4:6: + at /pwd/in.nix:4:6: 3| b = 2; 4| in a - b | ^ diff --git a/tests/functional/lang/eval-okay-arithmetic-override.exp b/tests/functional2/lang/arithmetic/eval-okay-override.out.exp similarity index 100% rename from tests/functional/lang/eval-okay-arithmetic-override.exp rename to tests/functional2/lang/arithmetic/eval-okay-override.out.exp diff --git a/tests/functional/lang/eval-okay-arithmetic.exp b/tests/functional2/lang/arithmetic/eval-okay.out.exp similarity index 100% rename from tests/functional/lang/eval-okay-arithmetic.exp rename to tests/functional2/lang/arithmetic/eval-okay.out.exp diff --git a/tests/functional/lang/eval-fail-overflowing-add.nix b/tests/functional2/lang/arithmetic/in-overflowing-add.nix similarity index 100% rename from tests/functional/lang/eval-fail-overflowing-add.nix rename to tests/functional2/lang/arithmetic/in-overflowing-add.nix diff --git a/tests/functional/lang/eval-fail-overflowing-div.nix b/tests/functional2/lang/arithmetic/in-overflowing-div.nix similarity index 100% rename from tests/functional/lang/eval-fail-overflowing-div.nix rename to tests/functional2/lang/arithmetic/in-overflowing-div.nix diff --git a/tests/functional/lang/eval-fail-overflowing-mul.nix b/tests/functional2/lang/arithmetic/in-overflowing-mul.nix similarity index 100% rename from tests/functional/lang/eval-fail-overflowing-mul.nix rename to tests/functional2/lang/arithmetic/in-overflowing-mul.nix diff --git a/tests/functional/lang/eval-fail-overflowing-sub.nix b/tests/functional2/lang/arithmetic/in-overflowing-sub.nix similarity index 100% rename from tests/functional/lang/eval-fail-overflowing-sub.nix rename to tests/functional2/lang/arithmetic/in-overflowing-sub.nix diff --git a/tests/functional/lang/eval-okay-arithmetic-override.nix b/tests/functional2/lang/arithmetic/in-override.nix similarity index 100% rename from tests/functional/lang/eval-okay-arithmetic-override.nix rename to tests/functional2/lang/arithmetic/in-override.nix diff --git a/tests/functional/lang/parse-okay-arithmetic.nix b/tests/functional2/lang/arithmetic/in-precedence.nix similarity index 100% rename from tests/functional/lang/parse-okay-arithmetic.nix rename to tests/functional2/lang/arithmetic/in-precedence.nix diff --git a/tests/functional/lang/eval-okay-arithmetic.nix b/tests/functional2/lang/arithmetic/in.nix similarity index 100% rename from tests/functional/lang/eval-okay-arithmetic.nix rename to tests/functional2/lang/arithmetic/in.nix diff --git a/tests/functional/lang/parse-okay-arithmetic.exp b/tests/functional2/lang/arithmetic/parse-okay-precedence.out.exp similarity index 100% rename from tests/functional/lang/parse-okay-arithmetic.exp rename to tests/functional2/lang/arithmetic/parse-okay-precedence.out.exp diff --git a/tests/functional2/lang/arithmetic/test.toml b/tests/functional2/lang/arithmetic/test.toml new file mode 100644 index 000000000..946420e88 --- /dev/null +++ b/tests/functional2/lang/arithmetic/test.toml @@ -0,0 +1,16 @@ +[[test]] +runner = "eval-okay" + +[[test]] +runner = "eval-okay" +in = "in-override.nix" +flags = [ "--extra-deprecated-features", "shadow-internal-symbols" ] + +[[test]] +runner = "eval-fail" +in = [ "in-overflowing-add.nix", "in-overflowing-div.nix", "in-overflowing-mul.nix", "in-overflowing-sub.nix" ] +matrix = true + +[[test]] +runner = "parse-okay" +in = "in-precedence.nix"