From f0f5435e25541c6f1ae17e77d44c54df881320cc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 29 Sep 2022 20:38:07 +0300 Subject: test(tvix/eval): reactivate nested key tests in plain attribute sets Change-Id: Id25cde5a6562e1598dcbbf7945ecdfacac5faed7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6807 Reviewed-by: grfn Reviewed-by: sterni Tested-by: BuildkiteCI --- .../disabled-eval-okay-contains-nested-non-set.nix | 3 --- .../disabled-eval-okay-deeply-nested-attrs.nix | 1 - .../disabled-eval-okay-multiple-nested-attrs.nix | 1 - .../disabled-eval-okay-nested-has-attrs.nix | 26 ---------------------- ...sabled-eval-okay-or-operator-nested-default.nix | 1 - .../disabled-eval-okay-or-operator-nested.nix | 1 - .../disabled-eval-okay-or-operator-non-set.nix | 2 -- ...disabled-eval-okay-overlapping-nested-attrs.nix | 4 ---- .../disabled-eval-okay-simple-nested-attrs.nix | 1 - .../eval-okay-contains-nested-non-set.nix | 3 +++ .../tvix_tests/eval-okay-deeply-nested-attrs.nix | 1 + .../tvix_tests/eval-okay-multiple-nested-attrs.nix | 1 + .../tvix_tests/eval-okay-nested-has-attrs.nix | 26 ++++++++++++++++++++++ .../eval-okay-or-operator-nested-default.nix | 1 + .../tvix_tests/eval-okay-or-operator-nested.nix | 1 + .../tvix_tests/eval-okay-or-operator-non-set.nix | 2 ++ .../eval-okay-overlapping-nested-attrs.nix | 4 ++++ .../tvix_tests/eval-okay-simple-nested-attrs.nix | 1 + 18 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-contains-nested-non-set.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-deeply-nested-attrs.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-multiple-nested-attrs.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-nested-has-attrs.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested-default.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-non-set.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-overlapping-nested-attrs.nix delete mode 100644 tvix/eval/src/tests/tvix_tests/disabled-eval-okay-simple-nested-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-has-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested-default.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-non-set.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-contains-nested-non-set.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-contains-nested-non-set.nix deleted file mode 100644 index 361ba9144594..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-contains-nested-non-set.nix +++ /dev/null @@ -1,3 +0,0 @@ -# ? operator should work even if encountering a non-set value on the -# walk -{ a.b = 42; } ? a.b.c diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-deeply-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-deeply-nested-attrs.nix deleted file mode 100644 index 91649d0c6dd4..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-deeply-nested-attrs.nix +++ /dev/null @@ -1 +0,0 @@ -{ a.b.c.d.e.f.g = "deep!"; } diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-multiple-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-multiple-nested-attrs.nix deleted file mode 100644 index 5d611930ca7a..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-multiple-nested-attrs.nix +++ /dev/null @@ -1 +0,0 @@ -{ a.b = 15; b.c = "test"; } diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-nested-has-attrs.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-nested-has-attrs.nix deleted file mode 100644 index 47dcec7a95f4..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-nested-has-attrs.nix +++ /dev/null @@ -1,26 +0,0 @@ -let - set = { - a.b.c = 123; - foo = { - bar = 23; - }; - baz = 1; - }; - - tes = "random value"; -in - -[ - (set ? a) - (set ? a.b) - (set ? a.b.c) - (set ? foo) - (set ? foo.bar) - (set.foo ? bar) - (set ? baz) - (set ? x) - (set ? x.y.z) - (tes ? bar) - (tes ? x.y.z) - (null ? null) -] diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested-default.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested-default.nix deleted file mode 100644 index ceffd0697b28..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested-default.nix +++ /dev/null @@ -1 +0,0 @@ -{ a.b = 1; }.a.c or 2 diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested.nix deleted file mode 100644 index 1a76594546b3..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-nested.nix +++ /dev/null @@ -1 +0,0 @@ -{ a.b = 1; }.a.b or 2 diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-non-set.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-non-set.nix deleted file mode 100644 index fd09bfee64c2..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-or-operator-non-set.nix +++ /dev/null @@ -1,2 +0,0 @@ -# `or` operator should keep working if it encounters a non-set type. -{ a.b = 42; }.a.b.c or "works fine" diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-overlapping-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-overlapping-nested-attrs.nix deleted file mode 100644 index 4154ff9da29f..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-overlapping-nested-attrs.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - a.b = 15; - a.c = "test"; -} diff --git a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-simple-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-simple-nested-attrs.nix deleted file mode 100644 index a97394d16523..000000000000 --- a/tvix/eval/src/tests/tvix_tests/disabled-eval-okay-simple-nested-attrs.nix +++ /dev/null @@ -1 +0,0 @@ -{ a.b = 42; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix new file mode 100644 index 000000000000..361ba9144594 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix @@ -0,0 +1,3 @@ +# ? operator should work even if encountering a non-set value on the +# walk +{ a.b = 42; } ? a.b.c diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-attrs.nix new file mode 100644 index 000000000000..91649d0c6dd4 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-attrs.nix @@ -0,0 +1 @@ +{ a.b.c.d.e.f.g = "deep!"; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix new file mode 100644 index 000000000000..5d611930ca7a --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix @@ -0,0 +1 @@ +{ a.b = 15; b.c = "test"; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-has-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-has-attrs.nix new file mode 100644 index 000000000000..47dcec7a95f4 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-has-attrs.nix @@ -0,0 +1,26 @@ +let + set = { + a.b.c = 123; + foo = { + bar = 23; + }; + baz = 1; + }; + + tes = "random value"; +in + +[ + (set ? a) + (set ? a.b) + (set ? a.b.c) + (set ? foo) + (set ? foo.bar) + (set.foo ? bar) + (set ? baz) + (set ? x) + (set ? x.y.z) + (tes ? bar) + (tes ? x.y.z) + (null ? null) +] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested-default.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested-default.nix new file mode 100644 index 000000000000..ceffd0697b28 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested-default.nix @@ -0,0 +1 @@ +{ a.b = 1; }.a.c or 2 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested.nix new file mode 100644 index 000000000000..1a76594546b3 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-nested.nix @@ -0,0 +1 @@ +{ a.b = 1; }.a.b or 2 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-non-set.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-non-set.nix new file mode 100644 index 000000000000..fd09bfee64c2 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-or-operator-non-set.nix @@ -0,0 +1,2 @@ +# `or` operator should keep working if it encounters a non-set type. +{ a.b = 42; }.a.b.c or "works fine" diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix new file mode 100644 index 000000000000..4154ff9da29f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix @@ -0,0 +1,4 @@ +{ + a.b = 15; + a.c = "test"; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix new file mode 100644 index 000000000000..a97394d16523 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix @@ -0,0 +1 @@ +{ a.b = 42; } -- cgit 1.4.1