From f991ff929401df79d4ad2320bf3e796c935e830a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 17 Oct 2022 21:31:36 -0700 Subject: feat(tvix/eval): expect not-yet-passing tests to fail It is helpful to be able to use the test suite as a regression test: make a change to the compiler/vm, re-run the tests, and if there are any failures you know it's your fault. Right now we can't do that, because the expected-to-fail tests are mixed in with the expected-to-pass tests. So we can't use them as a regression test. Change-Id: Ied606882b9835a7effd7e75bfcf3e5f827e0a2c8 Signed-off-by: Adam Joseph Reviewed-on: https://cl.tvl.fyi/c/depot/+/7036 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/default.nix | 1 + tvix/eval/src/tests/mod.rs | 62 +++- .../tests/nix_tests/eval-fail-antiquoted-path.nix | 4 - .../tests/nix_tests/eval-fail-bad-antiquote-2.nix | 1 - .../eval/src/tests/nix_tests/eval-fail-scope-5.nix | 10 - .../tests/nix_tests/eval-fail-undeclared-arg.nix | 1 - tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix | 4 - .../src/tests/nix_tests/eval-okay-autoargs.exp | 1 - .../src/tests/nix_tests/eval-okay-autoargs.flags | 1 - .../src/tests/nix_tests/eval-okay-autoargs.nix | 15 - .../src/tests/nix_tests/eval-okay-builtins.exp | 1 - .../src/tests/nix_tests/eval-okay-builtins.nix | 12 - .../src/tests/nix_tests/eval-okay-closure.exp.xml | 343 --------------------- .../eval/src/tests/nix_tests/eval-okay-closure.nix | 13 - .../nix_tests/eval-okay-context-introspection.exp | 1 - .../nix_tests/eval-okay-context-introspection.nix | 24 -- .../eval/src/tests/nix_tests/eval-okay-context.exp | 1 - .../eval/src/tests/nix_tests/eval-okay-context.nix | 6 - tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix | 5 - .../eval/src/tests/nix_tests/eval-okay-deepseq.exp | 1 - .../eval/src/tests/nix_tests/eval-okay-deepseq.nix | 1 - .../nix_tests/eval-okay-delayed-with-inherit.exp | 1 - .../nix_tests/eval-okay-delayed-with-inherit.nix | 24 -- .../src/tests/nix_tests/eval-okay-delayed-with.exp | 1 - .../src/tests/nix_tests/eval-okay-delayed-with.nix | 29 -- .../tests/nix_tests/eval-okay-eq-derivations.exp | 1 - .../tests/nix_tests/eval-okay-eq-derivations.nix | 10 - .../src/tests/nix_tests/eval-okay-eq.exp.disabled | 1 - tvix/eval/src/tests/nix_tests/eval-okay-eq.nix | 3 - .../src/tests/nix_tests/eval-okay-fromTOML.exp | 1 - .../src/tests/nix_tests/eval-okay-fromTOML.nix | 208 ------------- .../src/tests/nix_tests/eval-okay-fromjson.exp | 1 - .../src/tests/nix_tests/eval-okay-fromjson.nix | 36 --- .../tests/nix_tests/eval-okay-functionargs.exp.xml | 15 - .../src/tests/nix_tests/eval-okay-functionargs.nix | 80 ----- .../nix_tests/eval-okay-getattrpos-undefined.exp | 1 - .../nix_tests/eval-okay-getattrpos-undefined.nix | 1 - .../src/tests/nix_tests/eval-okay-getattrpos.exp | 1 - .../src/tests/nix_tests/eval-okay-getattrpos.nix | 6 - tvix/eval/src/tests/nix_tests/eval-okay-getenv.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-getenv.nix | 1 - .../src/tests/nix_tests/eval-okay-hashfile.exp | 1 - .../src/tests/nix_tests/eval-okay-hashfile.nix | 4 - .../src/tests/nix_tests/eval-okay-hashstring.exp | 1 - .../src/tests/nix_tests/eval-okay-hashstring.nix | 4 - tvix/eval/src/tests/nix_tests/eval-okay-import.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-import.nix | 11 - .../src/tests/nix_tests/eval-okay-mapattrs.exp | 1 - .../src/tests/nix_tests/eval-okay-mapattrs.nix | 3 - .../src/tests/nix_tests/eval-okay-overrides.exp | 1 - .../src/tests/nix_tests/eval-okay-overrides.nix | 9 - tvix/eval/src/tests/nix_tests/eval-okay-path.nix | 7 - .../src/tests/nix_tests/eval-okay-pathexists.exp | 1 - .../src/tests/nix_tests/eval-okay-pathexists.nix | 5 - .../src/tests/nix_tests/eval-okay-regex-split.exp | 1 - .../src/tests/nix_tests/eval-okay-regex-split.nix | 48 --- .../tests/nix_tests/eval-okay-replacestrings.exp | 1 - .../tests/nix_tests/eval-okay-replacestrings.nix | 11 - .../src/tests/nix_tests/eval-okay-search-path.exp | 1 - .../tests/nix_tests/eval-okay-search-path.flags | 1 - .../src/tests/nix_tests/eval-okay-search-path.nix | 11 - tvix/eval/src/tests/nix_tests/eval-okay-sort.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-sort.nix | 8 - .../src/tests/nix_tests/eval-okay-tail-call-1.exp | 1 + .../nix_tests/eval-okay-tail-call-1.exp-disabled | 1 - tvix/eval/src/tests/nix_tests/eval-okay-tojson.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-tojson.nix | 13 - tvix/eval/src/tests/nix_tests/eval-okay-toxml.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-toxml.nix | 3 - tvix/eval/src/tests/nix_tests/eval-okay-toxml2.exp | 1 - tvix/eval/src/tests/nix_tests/eval-okay-toxml2.nix | 1 - .../eval/src/tests/nix_tests/eval-okay-xml.exp.xml | 52 ---- tvix/eval/src/tests/nix_tests/eval-okay-xml.nix | 21 -- .../notyetpassing/eval-fail-antiquoted-path.nix | 4 + .../notyetpassing/eval-fail-bad-antiquote-2.nix | 1 + .../nix_tests/notyetpassing/eval-fail-scope-5.nix | 10 + .../notyetpassing/eval-fail-undeclared-arg.nix | 1 + .../nix_tests/notyetpassing/eval-okay-attrs6.exp | 1 + .../nix_tests/notyetpassing/eval-okay-attrs6.nix | 4 + .../nix_tests/notyetpassing/eval-okay-autoargs.exp | 1 + .../notyetpassing/eval-okay-autoargs.flags | 1 + .../nix_tests/notyetpassing/eval-okay-autoargs.nix | 15 + .../nix_tests/notyetpassing/eval-okay-builtins.exp | 1 + .../nix_tests/notyetpassing/eval-okay-builtins.nix | 12 + .../nix_tests/notyetpassing/eval-okay-closure.exp | 343 +++++++++++++++++++++ .../nix_tests/notyetpassing/eval-okay-closure.nix | 13 + .../eval-okay-context-introspection.exp | 1 + .../eval-okay-context-introspection.nix | 24 ++ .../nix_tests/notyetpassing/eval-okay-context.exp | 1 + .../nix_tests/notyetpassing/eval-okay-context.nix | 6 + .../nix_tests/notyetpassing/eval-okay-curpos.exp | 1 + .../nix_tests/notyetpassing/eval-okay-curpos.nix | 5 + .../nix_tests/notyetpassing/eval-okay-deepseq.exp | 1 + .../nix_tests/notyetpassing/eval-okay-deepseq.nix | 1 + .../eval-okay-delayed-with-inherit.exp | 1 + .../eval-okay-delayed-with-inherit.nix | 24 ++ .../notyetpassing/eval-okay-delayed-with.exp | 1 + .../notyetpassing/eval-okay-delayed-with.nix | 29 ++ .../notyetpassing/eval-okay-eq-derivations.exp | 1 + .../notyetpassing/eval-okay-eq-derivations.nix | 10 + .../tests/nix_tests/notyetpassing/eval-okay-eq.exp | 1 + .../tests/nix_tests/notyetpassing/eval-okay-eq.nix | 3 + .../nix_tests/notyetpassing/eval-okay-fromTOML.exp | 1 + .../nix_tests/notyetpassing/eval-okay-fromTOML.nix | 208 +++++++++++++ .../nix_tests/notyetpassing/eval-okay-fromjson.exp | 1 + .../nix_tests/notyetpassing/eval-okay-fromjson.nix | 36 +++ .../notyetpassing/eval-okay-functionargs.exp | 15 + .../notyetpassing/eval-okay-functionargs.nix | 80 +++++ .../eval-okay-getattrpos-undefined.exp | 1 + .../eval-okay-getattrpos-undefined.nix | 1 + .../notyetpassing/eval-okay-getattrpos.exp | 1 + .../notyetpassing/eval-okay-getattrpos.nix | 6 + .../nix_tests/notyetpassing/eval-okay-getenv.exp | 1 + .../nix_tests/notyetpassing/eval-okay-getenv.nix | 1 + .../nix_tests/notyetpassing/eval-okay-hashfile.exp | 1 + .../nix_tests/notyetpassing/eval-okay-hashfile.nix | 4 + .../notyetpassing/eval-okay-hashstring.exp | 1 + .../notyetpassing/eval-okay-hashstring.nix | 4 + .../nix_tests/notyetpassing/eval-okay-import.exp | 1 + .../nix_tests/notyetpassing/eval-okay-import.nix | 11 + .../nix_tests/notyetpassing/eval-okay-mapattrs.exp | 1 + .../nix_tests/notyetpassing/eval-okay-mapattrs.nix | 3 + .../notyetpassing/eval-okay-overrides.exp | 1 + .../notyetpassing/eval-okay-overrides.nix | 9 + .../nix_tests/notyetpassing/eval-okay-path.nix | 7 + .../notyetpassing/eval-okay-pathexists.exp | 1 + .../notyetpassing/eval-okay-pathexists.nix | 5 + .../notyetpassing/eval-okay-regex-split.exp | 1 + .../notyetpassing/eval-okay-regex-split.nix | 48 +++ .../notyetpassing/eval-okay-replacestrings.exp | 1 + .../notyetpassing/eval-okay-replacestrings.nix | 11 + .../notyetpassing/eval-okay-search-path.exp | 1 + .../notyetpassing/eval-okay-search-path.flags | 1 + .../notyetpassing/eval-okay-search-path.nix | 11 + .../nix_tests/notyetpassing/eval-okay-sort.exp | 1 + .../nix_tests/notyetpassing/eval-okay-sort.nix | 8 + .../nix_tests/notyetpassing/eval-okay-tojson.exp | 1 + .../nix_tests/notyetpassing/eval-okay-tojson.nix | 13 + .../nix_tests/notyetpassing/eval-okay-toxml.exp | 1 + .../nix_tests/notyetpassing/eval-okay-toxml.nix | 3 + .../nix_tests/notyetpassing/eval-okay-toxml2.exp | 1 + .../nix_tests/notyetpassing/eval-okay-toxml2.nix | 1 + .../nix_tests/notyetpassing/eval-okay-xml.exp | 52 ++++ .../nix_tests/notyetpassing/eval-okay-xml.nix | 21 ++ 146 files changed, 1144 insertions(+), 1109 deletions(-) delete mode 100644 tvix/eval/src/tests/nix_tests/eval-fail-antiquoted-path.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-fail-bad-antiquote-2.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-fail-scope-5.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-fail-undeclared-arg.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-autoargs.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-autoargs.flags delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-autoargs.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-builtins.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-builtins.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-closure.exp.xml delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-closure.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-context.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-context.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-deepseq.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-deepseq.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-eq.exp.disabled delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-eq.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-fromjson.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp.xml delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-functionargs.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-getenv.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-getenv.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-hashfile.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-hashfile.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-hashstring.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-hashstring.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-import.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-import.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-overrides.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-overrides.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-path.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-pathexists.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-pathexists.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-regex-split.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-regex-split.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-search-path.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-search-path.flags delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-search-path.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-sort.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-sort.nix create mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp-disabled delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-tojson.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-tojson.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-toxml.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-toxml.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-toxml2.exp delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-toxml2.nix delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-xml.exp.xml delete mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-xml.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-antiquoted-path.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.nix create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.exp create mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.nix (limited to 'tvix') diff --git a/tvix/eval/default.nix b/tvix/eval/default.nix index 2989e8348f15..7328ed7ee2c2 100644 --- a/tvix/eval/default.nix +++ b/tvix/eval/default.nix @@ -108,6 +108,7 @@ lib.fix (self: depot.third_party.naersk.buildPackage (lib.fix (naerskArgs: { case "$(basename $i)" in eval-okay-search-path.nix) ;& + eval-okay-tail-call-1.nix | \ eval-okay-fromjson.nix) # TODO(sterni,grfn): fix these tests echo "SKIPPED: $i" diff --git a/tvix/eval/src/tests/mod.rs b/tvix/eval/src/tests/mod.rs index a0980cc029ab..8a58b3cc7973 100644 --- a/tvix/eval/src/tests/mod.rs +++ b/tvix/eval/src/tests/mod.rs @@ -14,20 +14,31 @@ fn eval_test(code_path: &str, expect_success: bool) { match interpret(&code, Some(code_path.into()), Options::test_options()) { Ok(result) => { - if !expect_success { - panic!( - "test should have failed, but succeeded with output {}", - result - ); - } let result_str = format!("{}", result); - let exp = - std::fs::read_to_string(exp_path).expect("should be able to read test expectation"); - assert_eq!( - result_str, - exp.trim(), - "result value representation (left) must match expectation (right)" - ); + if let Ok(exp) = std::fs::read_to_string(exp_path) { + if expect_success { + assert_eq!( + result_str, + exp.trim(), + "result value representation (left) must match expectation (right)" + ); + } else { + assert_ne!( + result_str, + exp.trim(), + "test passed unexpectedly! consider moving it out of notyetpassing" + ); + } + } else { + if expect_success { + panic!("should be able to read test expectation"); + } else { + panic!( + "test should have failed, but succeeded with output {}", + result + ); + } + } } Err(e) => { if expect_success { @@ -67,13 +78,36 @@ fn eval_okay(code_path: &str) { eval_test(code_path, true) } -// eval-fail-* tests from the original Nix test suite. +// eval-okay-* tests from the original Nix test suite. #[cfg(feature = "nix_tests")] #[test_resources("src/tests/nix_tests/eval-okay-*.nix")] fn nix_eval_okay(code_path: &str) { eval_test(code_path, true) } +// eval-okay-* tests from the original Nix test suite which do not yet pass for tvix +// +// Eventually there will be none of these left, and this function +// will disappear :) Until then, to run these tests, use `cargo test +// --features expected_failures`. +// +// Please don't submit failing tests unless they're in +// notyetpassing; this makes the test suite much more useful for +// regression testing, since there should always be zero non-ignored +// failing tests. +// +// Unfortunately test_generator is unmaintained, so the PRs to make +// it understand #[ignored] has been sitting for two years, so we +// can't use `cargo test --include-ignored`, which is the normal way +// of handling this situation. +// +// https://github.com/frehberg/test-generator/pull/10 +// https://github.com/frehberg/test-generator/pull/8 +#[test_resources("src/tests/nix_tests/notyetpassing/eval-okay-*.nix")] +fn nix_eval_okay_currently_failing(code_path: &str) { + eval_test(code_path, false) +} + // eval-fail-* tests contain a snippet of Nix code, which is // expected to fail evaluation. The exact type of failure // (assertion, parse error, etc) is not currently checked. diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-antiquoted-path.nix b/tvix/eval/src/tests/nix_tests/eval-fail-antiquoted-path.nix deleted file mode 100644 index f2f08107b516..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-fail-antiquoted-path.nix +++ /dev/null @@ -1,4 +0,0 @@ -# This must fail to evaluate, since ./fnord doesn't exist. If it did -# exist, it would produce "/nix/store/-fnord/xyzzy" (with an -# appropriate context). -"${./fnord}/xyzzy" diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-bad-antiquote-2.nix b/tvix/eval/src/tests/nix_tests/eval-fail-bad-antiquote-2.nix deleted file mode 100644 index 3745235ce95e..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-fail-bad-antiquote-2.nix +++ /dev/null @@ -1 +0,0 @@ -"${./fnord}" diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-scope-5.nix b/tvix/eval/src/tests/nix_tests/eval-fail-scope-5.nix deleted file mode 100644 index f89a65a99be3..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-fail-scope-5.nix +++ /dev/null @@ -1,10 +0,0 @@ -let { - - x = "a"; - y = "b"; - - f = {x ? y, y ? x}: x + y; - - body = f {}; - -} diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-undeclared-arg.nix b/tvix/eval/src/tests/nix_tests/eval-fail-undeclared-arg.nix deleted file mode 100644 index cafdf1636272..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-fail-undeclared-arg.nix +++ /dev/null @@ -1 +0,0 @@ -({x, z}: x + z) {x = "foo"; y = "bla"; z = "bar";} diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp b/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp deleted file mode 100644 index b46938032e73..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp +++ /dev/null @@ -1 +0,0 @@ -{ __overrides = { bar = "qux"; }; bar = "qux"; foo = "bar"; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix b/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix deleted file mode 100644 index 2e5c85483be6..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix +++ /dev/null @@ -1,4 +0,0 @@ -rec { - "${"foo"}" = "bar"; - __overrides = { bar = "qux"; }; -} diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.exp b/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.exp deleted file mode 100644 index 7a8391786a09..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.exp +++ /dev/null @@ -1 +0,0 @@ -"xyzzy!xyzzy!foobar" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.flags b/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.flags deleted file mode 100644 index 217c7a5ae291..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.flags +++ /dev/null @@ -1 +0,0 @@ ---arg lib import(nix_tests/lib.nix) --argstr xyzzy xyzzy! -A result diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.nix b/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.nix deleted file mode 100644 index 815f51b1d67a..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.nix +++ /dev/null @@ -1,15 +0,0 @@ -let - - foobar = "foobar"; - -in - -{ xyzzy2 ? xyzzy # mutually recursive args -, xyzzy ? "blaat" # will be overridden by --argstr -, fb ? foobar -, lib # will be set by --arg -}: - -{ - result = lib.concat [xyzzy xyzzy2 fb]; -} diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-builtins.exp b/tvix/eval/src/tests/nix_tests/eval-okay-builtins.exp deleted file mode 100644 index 0661686d611d..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-builtins.exp +++ /dev/null @@ -1 +0,0 @@ -/foo diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-builtins.nix b/tvix/eval/src/tests/nix_tests/eval-okay-builtins.nix deleted file mode 100644 index e9d65e88a817..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-builtins.nix +++ /dev/null @@ -1,12 +0,0 @@ -assert builtins ? currentSystem; -assert !builtins ? __currentSystem; - -let { - - x = if builtins ? dirOf then builtins.dirOf /foo/bar else ""; - - y = if builtins ? fnord then builtins.fnord "foo" else ""; - - body = x + y; - -} diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-closure.exp.xml b/tvix/eval/src/tests/nix_tests/eval-okay-closure.exp.xml deleted file mode 100644 index dffc03a99891..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-closure.exp.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-closure.nix b/tvix/eval/src/tests/nix_tests/eval-okay-closure.nix deleted file mode 100644 index cccd4dc35730..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-closure.nix +++ /dev/null @@ -1,13 +0,0 @@ -let - - closure = builtins.genericClosure { - startSet = [{key = 80;}]; - operator = {key, foo ? false}: - if builtins.lessThan key 0 - then [] - else [{key = builtins.sub key 9;} {key = builtins.sub key 13; foo = true;}]; - }; - - sort = (import ./lib.nix).sortBy (a: b: builtins.lessThan a.key b.key); - -in sort closure diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.exp b/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.exp deleted file mode 100644 index 27ba77ddaf61..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.exp +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.nix b/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.nix deleted file mode 100644 index 43178bd2eef9..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.nix +++ /dev/null @@ -1,24 +0,0 @@ -let - drv = derivation { - name = "fail"; - builder = "/bin/false"; - system = "x86_64-linux"; - outputs = [ "out" "foo" ]; - }; - - path = "${./eval-okay-context-introspection.nix}"; - - desired-context = { - "${builtins.unsafeDiscardStringContext path}" = { - path = true; - }; - "${builtins.unsafeDiscardStringContext drv.drvPath}" = { - outputs = [ "foo" "out" ]; - allOutputs = true; - }; - }; - - legit-context = builtins.getContext "${path}${drv.outPath}${drv.foo.outPath}${drv.drvPath}"; - - constructed-context = builtins.getContext (builtins.appendContext "" desired-context); -in legit-context == constructed-context diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-context.exp b/tvix/eval/src/tests/nix_tests/eval-okay-context.exp deleted file mode 100644 index 2f535bdbc454..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context.exp +++ /dev/null @@ -1 +0,0 @@ -"foo eval-okay-context.nix bar" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-context.nix b/tvix/eval/src/tests/nix_tests/eval-okay-context.nix deleted file mode 100644 index 7b9531cfe9e1..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context.nix +++ /dev/null @@ -1,6 +0,0 @@ -let s = "foo ${builtins.substring 33 100 (baseNameOf "${./eval-okay-context.nix}")} bar"; -in - if s != "foo eval-okay-context.nix bar" - then abort "context not discarded" - else builtins.unsafeDiscardStringContext s - diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp b/tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp deleted file mode 100644 index 65fd65b4d01f..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp +++ /dev/null @@ -1 +0,0 @@ -[ 3 7 4 9 ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix b/tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix deleted file mode 100644 index b79553df0bd3..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix +++ /dev/null @@ -1,5 +0,0 @@ -# Bla -let - x = __curPos; - y = __curPos; -in [ x.line x.column y.line y.column ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-deepseq.exp b/tvix/eval/src/tests/nix_tests/eval-okay-deepseq.exp deleted file mode 100644 index 8d38505c1686..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-deepseq.exp +++ /dev/null @@ -1 +0,0 @@ -456 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-deepseq.nix b/tvix/eval/src/tests/nix_tests/eval-okay-deepseq.nix deleted file mode 100644 index 53aa4b1dc251..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-deepseq.nix +++ /dev/null @@ -1 +0,0 @@ -builtins.deepSeq (let as = { x = 123; y = as; }; in as) 456 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.exp b/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.exp deleted file mode 100644 index eaacb55c1aff..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.exp +++ /dev/null @@ -1 +0,0 @@ -"b-overridden" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.nix b/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.nix deleted file mode 100644 index 84b388c27130..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.nix +++ /dev/null @@ -1,24 +0,0 @@ -let - pkgs_ = with pkgs; { - a = derivation { - name = "a"; - system = builtins.currentSystem; - builder = "/bin/sh"; - args = [ "-c" "touch $out" ]; - inherit b; - }; - - inherit b; - }; - - packageOverrides = p: { - b = derivation { - name = "b-overridden"; - system = builtins.currentSystem; - builder = "/bin/sh"; - args = [ "-c" "touch $out" ]; - }; - }; - - pkgs = pkgs_ // (packageOverrides pkgs_); -in pkgs.a.b.name diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.exp b/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.exp deleted file mode 100644 index 8e7c61ab8e77..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.exp +++ /dev/null @@ -1 +0,0 @@ -"b-overridden b-overridden a" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.nix b/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.nix deleted file mode 100644 index 3fb023e1cd42..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.nix +++ /dev/null @@ -1,29 +0,0 @@ -let - - pkgs_ = with pkgs; { - a = derivation { - name = "a"; - system = builtins.currentSystem; - builder = "/bin/sh"; - args = [ "-c" "touch $out" ]; - inherit b; - }; - - b = derivation { - name = "b"; - system = builtins.currentSystem; - builder = "/bin/sh"; - args = [ "-c" "touch $out" ]; - inherit a; - }; - - c = b; - }; - - packageOverrides = pkgs: with pkgs; { - b = derivation (b.drvAttrs // { name = "${b.name}-overridden"; }); - }; - - pkgs = pkgs_ // (packageOverrides pkgs_); - -in "${pkgs.a.b.name} ${pkgs.c.name} ${pkgs.b.a.name}" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.exp b/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.exp deleted file mode 100644 index ec04aab6aeec..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.exp +++ /dev/null @@ -1 +0,0 @@ -[ true true true false ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.nix b/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.nix deleted file mode 100644 index d526cb4a2161..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.nix +++ /dev/null @@ -1,10 +0,0 @@ -let - - drvA1 = derivation { name = "a"; builder = "/foo"; system = "i686-linux"; }; - drvA2 = derivation { name = "a"; builder = "/foo"; system = "i686-linux"; }; - drvA3 = derivation { name = "a"; builder = "/foo"; system = "i686-linux"; } // { dummy = 1; }; - - drvC1 = derivation { name = "c"; builder = "/foo"; system = "i686-linux"; }; - drvC2 = derivation { name = "c"; builder = "/bar"; system = "i686-linux"; }; - -in [ (drvA1 == drvA1) (drvA1 == drvA2) (drvA1 == drvA3) (drvC1 == drvC2) ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-eq.exp.disabled b/tvix/eval/src/tests/nix_tests/eval-okay-eq.exp.disabled deleted file mode 100644 index 2015847b65e7..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-eq.exp.disabled +++ /dev/null @@ -1 +0,0 @@ -Bool(True) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-eq.nix b/tvix/eval/src/tests/nix_tests/eval-okay-eq.nix deleted file mode 100644 index 73d200b38141..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-eq.nix +++ /dev/null @@ -1,3 +0,0 @@ -["foobar" (rec {x = 1; y = x;})] -== -[("foo" + "bar") ({x = 1; y = 1;})] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp b/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp deleted file mode 100644 index d0dd3af2c814..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp +++ /dev/null @@ -1 +0,0 @@ -[ { clients = { data = [ [ "gamma" "delta" ] [ 1 2 ] ]; hosts = [ "alpha" "omega" ]; }; database = { connection_max = 5000; enabled = true; ports = [ 8001 8001 8002 ]; server = "192.168.1.1"; }; owner = { name = "Tom Preston-Werner"; }; servers = { alpha = { dc = "eqdc10"; ip = "10.0.0.1"; }; beta = { dc = "eqdc10"; ip = "10.0.0.2"; }; }; title = "TOML Example"; } { "1234" = "value"; "127.0.0.1" = "value"; a = { b = { c = { }; }; }; arr1 = [ 1 2 3 ]; arr2 = [ "red" "yellow" "green" ]; arr3 = [ [ 1 2 ] [ 3 4 5 ] ]; arr4 = [ "all" "strings" "are the same" "type" ]; arr5 = [ [ 1 2 ] [ "a" "b" "c" ] ]; arr7 = [ 1 2 3 ]; arr8 = [ 1 2 ]; bare-key = "value"; bare_key = "value"; bin1 = 214; bool1 = true; bool2 = false; "character encoding" = "value"; d = { e = { f = { }; }; }; dog = { "tater.man" = { type = { name = "pug"; }; }; }; flt1 = 1; flt2 = 3.1415; flt3 = -0.01; flt4 = 5e+22; flt5 = 1e+06; flt6 = -0.02; flt7 = 6.626e-34; flt8 = 9.22462e+06; fruit = [ { name = "apple"; physical = { color = "red"; shape = "round"; }; variety = [ { name = "red delicious"; } { name = "granny smith"; } ]; } { name = "banana"; variety = [ { name = "plantain"; } ]; } ]; g = { h = { i = { }; }; }; hex1 = 3735928559; hex2 = 3735928559; hex3 = 3735928559; int1 = 99; int2 = 42; int3 = 0; int4 = -17; int5 = 1000; int6 = 5349221; int7 = 12345; j = { "ʞ" = { l = { }; }; }; key = "value"; key2 = "value"; name = "Orange"; oct1 = 342391; oct2 = 493; physical = { color = "orange"; shape = "round"; }; products = [ { name = "Hammer"; sku = 738594937; } { } { color = "gray"; name = "Nail"; sku = 284758393; } ]; "quoted \"value\"" = "value"; site = { "google.com" = true; }; str = "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."; table-1 = { key1 = "some string"; key2 = 123; }; table-2 = { key1 = "another string"; key2 = 456; }; x = { y = { z = { w = { animal = { type = { name = "pug"; }; }; name = { first = "Tom"; last = "Preston-Werner"; }; point = { x = 1; y = 2; }; }; }; }; }; "ʎǝʞ" = "value"; } { metadata = { "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"; "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"; "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"; "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"; }; package = [ { dependencies = [ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "aho-corasick"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.6.4"; } { name = "ansi_term"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.9.0"; } { dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "atty"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.2.10"; } ]; } { a = [ [ { b = true; } ] ]; c = [ [ { d = true; } ] ]; e = [ [ 123 ] ]; } ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix b/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix deleted file mode 100644 index 963932689942..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix +++ /dev/null @@ -1,208 +0,0 @@ -[ - - (builtins.fromTOML '' - # This is a TOML document. - - title = "TOML Example" - - [owner] - name = "Tom Preston-Werner" - #dob = 1979-05-27T07:32:00-08:00 # First class dates - - [database] - server = "192.168.1.1" - ports = [ 8001, 8001, 8002 ] - connection_max = 5000 - enabled = true - - [servers] - - # Indentation (tabs and/or spaces) is allowed but not required - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - - [clients] - data = [ ["gamma", "delta"], [1, 2] ] - - # Line breaks are OK when inside arrays - hosts = [ - "alpha", - "omega" - ] - '') - - (builtins.fromTOML '' - key = "value" - bare_key = "value" - bare-key = "value" - 1234 = "value" - - "127.0.0.1" = "value" - "character encoding" = "value" - "ʎǝʞ" = "value" - 'key2' = "value" - 'quoted "value"' = "value" - - name = "Orange" - - physical.color = "orange" - physical.shape = "round" - site."google.com" = true - - # This is legal according to the spec, but cpptoml doesn't handle it. - #a.b.c = 1 - #a.d = 2 - - str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." - - int1 = +99 - int2 = 42 - int3 = 0 - int4 = -17 - int5 = 1_000 - int6 = 5_349_221 - int7 = 1_2_3_4_5 - - hex1 = 0xDEADBEEF - hex2 = 0xdeadbeef - hex3 = 0xdead_beef - - oct1 = 0o01234567 - oct2 = 0o755 - - bin1 = 0b11010110 - - flt1 = +1.0 - flt2 = 3.1415 - flt3 = -0.01 - flt4 = 5e+22 - flt5 = 1e6 - flt6 = -2E-2 - flt7 = 6.626e-34 - flt8 = 9_224_617.445_991_228_313 - - bool1 = true - bool2 = false - - # FIXME: not supported because Nix doesn't have a date/time type. - #odt1 = 1979-05-27T07:32:00Z - #odt2 = 1979-05-27T00:32:00-07:00 - #odt3 = 1979-05-27T00:32:00.999999-07:00 - #odt4 = 1979-05-27 07:32:00Z - #ldt1 = 1979-05-27T07:32:00 - #ldt2 = 1979-05-27T00:32:00.999999 - #ld1 = 1979-05-27 - #lt1 = 07:32:00 - #lt2 = 00:32:00.999999 - - arr1 = [ 1, 2, 3 ] - arr2 = [ "red", "yellow", "green" ] - arr3 = [ [ 1, 2 ], [3, 4, 5] ] - arr4 = [ "all", 'strings', """are the same""", ''''type''''] - arr5 = [ [ 1, 2 ], ["a", "b", "c"] ] - - arr7 = [ - 1, 2, 3 - ] - - arr8 = [ - 1, - 2, # this is ok - ] - - [table-1] - key1 = "some string" - key2 = 123 - - - [table-2] - key1 = "another string" - key2 = 456 - - [dog."tater.man"] - type.name = "pug" - - [a.b.c] - [ d.e.f ] - [ g . h . i ] - [ j . "ʞ" . 'l' ] - [x.y.z.w] - - name = { first = "Tom", last = "Preston-Werner" } - point = { x = 1, y = 2 } - animal = { type.name = "pug" } - - [[products]] - name = "Hammer" - sku = 738594937 - - [[products]] - - [[products]] - name = "Nail" - sku = 284758393 - color = "gray" - - [[fruit]] - name = "apple" - - [fruit.physical] - color = "red" - shape = "round" - - [[fruit.variety]] - name = "red delicious" - - [[fruit.variety]] - name = "granny smith" - - [[fruit]] - name = "banana" - - [[fruit.variety]] - name = "plantain" - '') - - (builtins.fromTOML '' - [[package]] - name = "aho-corasick" - version = "0.6.4" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] - name = "ansi_term" - version = "0.9.0" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] - name = "atty" - version = "0.2.10" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [metadata] - "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" - "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" - "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" - "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" - '') - - (builtins.fromTOML '' - a = [[{ b = true }]] - c = [ [ { d = true } ] ] - e = [[123]] - '') - -] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.exp b/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.exp deleted file mode 100644 index 27ba77ddaf61..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.exp +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix b/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix deleted file mode 100644 index 102ee82b5e6b..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix +++ /dev/null @@ -1,36 +0,0 @@ -# RFC 7159, section 13. -builtins.fromJSON - '' - { - "Image": { - "Width": 800, - "Height": 600, - "Title": "View from 15th Floor", - "Thumbnail": { - "Url": "http://www.example.com/image/481989943", - "Height": 125, - "Width": 100 - }, - "Animated" : false, - "IDs": [116, 943, 234, 38793, true ,false,null, -100], - "Latitude": 37.7668, - "Longitude": -122.3959 - } - } - '' -== - { Image = - { Width = 800; - Height = 600; - Title = "View from 15th Floor"; - Thumbnail = - { Url = http://www.example.com/image/481989943; - Height = 125; - Width = 100; - }; - Animated = false; - IDs = [ 116 943 234 38793 true false null (0-100) ]; - Latitude = 37.7668; - Longitude = -122.3959; - }; - } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp.xml b/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp.xml deleted file mode 100644 index 651f54c36341..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.nix b/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.nix deleted file mode 100644 index 68dca62ee18d..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.nix +++ /dev/null @@ -1,80 +0,0 @@ -let - - stdenvFun = { }: { name = "stdenv"; }; - stdenv2Fun = { }: { name = "stdenv2"; }; - fetchurlFun = { stdenv }: assert stdenv.name == "stdenv"; { name = "fetchurl"; }; - atermFun = { stdenv, fetchurl }: { name = "aterm-${stdenv.name}"; }; - aterm2Fun = { stdenv, fetchurl }: { name = "aterm2-${stdenv.name}"; }; - nixFun = { stdenv, fetchurl, aterm }: { name = "nix-${stdenv.name}-${aterm.name}"; }; - - mplayerFun = - { stdenv, fetchurl, enableX11 ? false, xorg ? null, enableFoo ? true, foo ? null }: - assert stdenv.name == "stdenv2"; - assert enableX11 -> xorg.libXv.name == "libXv"; - assert enableFoo -> foo != null; - { name = "mplayer-${stdenv.name}.${xorg.libXv.name}-${xorg.libX11.name}"; }; - - makeOverridable = f: origArgs: f origArgs // - { override = newArgs: - makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs)); - }; - - callPackage_ = pkgs: f: args: - makeOverridable f ((builtins.intersectAttrs (builtins.functionArgs f) pkgs) // args); - - allPackages = - { overrides ? (pkgs: pkgsPrev: { }) }: - let - callPackage = callPackage_ pkgs; - pkgs = pkgsStd // (overrides pkgs pkgsStd); - pkgsStd = { - inherit pkgs; - stdenv = callPackage stdenvFun { }; - stdenv2 = callPackage stdenv2Fun { }; - fetchurl = callPackage fetchurlFun { }; - aterm = callPackage atermFun { }; - xorg = callPackage xorgFun { }; - mplayer = callPackage mplayerFun { stdenv = pkgs.stdenv2; enableFoo = false; }; - nix = callPackage nixFun { }; - }; - in pkgs; - - libX11Fun = { stdenv, fetchurl }: { name = "libX11"; }; - libX11_2Fun = { stdenv, fetchurl }: { name = "libX11_2"; }; - libXvFun = { stdenv, fetchurl, libX11 }: { name = "libXv"; }; - - xorgFun = - { pkgs }: - let callPackage = callPackage_ (pkgs // pkgs.xorg); in - { - libX11 = callPackage libX11Fun { }; - libXv = callPackage libXvFun { }; - }; - -in - -let - - pkgs = allPackages { }; - - pkgs2 = allPackages { - overrides = pkgs: pkgsPrev: { - stdenv = pkgs.stdenv2; - nix = pkgsPrev.nix.override { aterm = aterm2Fun { inherit (pkgs) stdenv fetchurl; }; }; - xorg = pkgsPrev.xorg // { libX11 = libX11_2Fun { inherit (pkgs) stdenv fetchurl; }; }; - }; - }; - -in - - [ pkgs.stdenv.name - pkgs.fetchurl.name - pkgs.aterm.name - pkgs2.aterm.name - pkgs.xorg.libX11.name - pkgs.xorg.libXv.name - pkgs.mplayer.name - pkgs2.mplayer.name - pkgs.nix.name - pkgs2.nix.name - ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.exp b/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.exp deleted file mode 100644 index 19765bd501b6..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.exp +++ /dev/null @@ -1 +0,0 @@ -null diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.nix b/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.nix deleted file mode 100644 index 14dd38f7734c..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.nix +++ /dev/null @@ -1 +0,0 @@ -builtins.unsafeGetAttrPos "abort" builtins diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.exp b/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.exp deleted file mode 100644 index 469249bbc646..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.exp +++ /dev/null @@ -1 +0,0 @@ -{ column = 5; file = "eval-okay-getattrpos.nix"; line = 3; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.nix b/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.nix deleted file mode 100644 index ca6b07961547..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.nix +++ /dev/null @@ -1,6 +0,0 @@ -let - as = { - foo = "bar"; - }; - pos = builtins.unsafeGetAttrPos "foo" as; -in { inherit (pos) column line; file = baseNameOf pos.file; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getenv.exp b/tvix/eval/src/tests/nix_tests/eval-okay-getenv.exp deleted file mode 100644 index 14e24d419005..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getenv.exp +++ /dev/null @@ -1 +0,0 @@ -"foobar" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getenv.nix b/tvix/eval/src/tests/nix_tests/eval-okay-getenv.nix deleted file mode 100644 index 4cfec5f553d9..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getenv.nix +++ /dev/null @@ -1 +0,0 @@ -builtins.getEnv "TEST_VAR" + (if builtins.getEnv "NO_SUCH_VAR" == "" then "bar" else "bla") diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-hashfile.exp b/tvix/eval/src/tests/nix_tests/eval-okay-hashfile.exp deleted file mode 100644 index ff1e8293ef22..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-hashfile.exp +++ /dev/null @@ -1 +0,0 @@ -[ "d3b07384d113edec49eaa6238ad5ff00" "0f343b0931126a20f133d67c2b018a3b" "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15" "60cacbf3d72e1e7834203da608037b1bf83b40e8" "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c" "5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" "0cf9180a764aba863a67b6d72f0918bc131c6772642cb2dce5a34f0a702f9470ddc2bf125c12198b1995c233c34b4afd346c54a2334c350a948a51b6e8b4e6b6" "8efb4f73c5655351c444eb109230c556d39e2c7624e9c11abc9e3fb4b9b9254218cc5085b454a9698d085cfa92198491f07a723be4574adc70617b73eb0b6461" ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-hashfile.nix b/tvix/eval/src/tests/nix_tests/eval-okay-hashfile.nix deleted file mode 100644 index aff5a1856814..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-hashfile.nix +++ /dev/null @@ -1,4 +0,0 @@ -let - paths = [ ./data ./binary-data ]; -in - builtins.concatLists (map (hash: map (builtins.hashFile hash) paths) ["md5" "sha1" "sha256" "sha512"]) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-hashstring.exp b/tvix/eval/src/tests/nix_tests/eval-okay-hashstring.exp deleted file mode 100644 index d720a082ddb3..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-hashstring.exp +++ /dev/null @@ -1 +0,0 @@ -[ "d41d8cd98f00b204e9800998ecf8427e" "6c69ee7f211c640419d5366cc076ae46" "bb3438fbabd460ea6dbd27d153e2233b" "da39a3ee5e6b4b0d3255bfef95601890afd80709" "cd54e8568c1b37cf1e5badb0779bcbf382212189" "6d12e10b1d331dad210e47fd25d4f260802b7e77" "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" "900a4469df00ccbfd0c145c6d1e4b7953dd0afafadd7534e3a4019e8d38fc663" "ad0387b3bd8652f730ca46d25f9c170af0fd589f42e7f23f5a9e6412d97d7e56" "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" "9d0886f8c6b389398a16257bc79780fab9831c7fc11c8ab07fa732cb7b348feade382f92617c9c5305fefba0af02ab5fd39a587d330997ff5bd0db19f7666653" "21644b72aa259e5a588cd3afbafb1d4310f4889680f6c83b9d531596a5a284f34dbebff409d23bcc86aee6bad10c891606f075c6f4755cb536da27db5693f3a7" ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-hashstring.nix b/tvix/eval/src/tests/nix_tests/eval-okay-hashstring.nix deleted file mode 100644 index b0f62b245ca8..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-hashstring.nix +++ /dev/null @@ -1,4 +0,0 @@ -let - strings = [ "" "text 1" "text 2" ]; -in - builtins.concatLists (map (hash: map (builtins.hashString hash) strings) ["md5" "sha1" "sha256" "sha512"]) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-import.exp b/tvix/eval/src/tests/nix_tests/eval-okay-import.exp deleted file mode 100644 index c508125b55be..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-import.exp +++ /dev/null @@ -1 +0,0 @@ -[ 1 2 3 4 5 6 7 8 9 10 ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-import.nix b/tvix/eval/src/tests/nix_tests/eval-okay-import.nix deleted file mode 100644 index 0b18d9413122..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-import.nix +++ /dev/null @@ -1,11 +0,0 @@ -let - - overrides = { - import = fn: scopedImport overrides fn; - - scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; - - builtins = builtins // overrides; - } // import ./lib.nix; - -in scopedImport overrides ./imported.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.exp b/tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.exp deleted file mode 100644 index 3f113f17bab1..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.exp +++ /dev/null @@ -1 +0,0 @@ -{ x = "x-foo"; y = "y-bar"; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.nix b/tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.nix deleted file mode 100644 index f075b6275e5a..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-mapattrs.nix +++ /dev/null @@ -1,3 +0,0 @@ -with import ./lib.nix; - -builtins.mapAttrs (name: value: name + "-" + value) { x = "foo"; y = "bar"; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.exp b/tvix/eval/src/tests/nix_tests/eval-okay-overrides.exp deleted file mode 100644 index 0cfbf08886fc..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.exp +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.nix b/tvix/eval/src/tests/nix_tests/eval-okay-overrides.nix deleted file mode 100644 index 358742b36e22..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.nix +++ /dev/null @@ -1,9 +0,0 @@ -let - - overrides = { a = 2; }; - -in (rec { - __overrides = overrides; - x = a; - a = 1; -}).x diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-path.nix b/tvix/eval/src/tests/nix_tests/eval-okay-path.nix deleted file mode 100644 index e67168cf3edf..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-path.nix +++ /dev/null @@ -1,7 +0,0 @@ -builtins.path - { path = ./.; - filter = path: _: baseNameOf path == "data"; - recursive = true; - sha256 = "1yhm3gwvg5a41yylymgblsclk95fs6jy72w0wv925mmidlhcq4sw"; - name = "output"; - } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-pathexists.exp b/tvix/eval/src/tests/nix_tests/eval-okay-pathexists.exp deleted file mode 100644 index 27ba77ddaf61..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-pathexists.exp +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-pathexists.nix b/tvix/eval/src/tests/nix_tests/eval-okay-pathexists.nix deleted file mode 100644 index 50c28ee0cd30..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-pathexists.nix +++ /dev/null @@ -1,5 +0,0 @@ -builtins.pathExists (builtins.toPath ./lib.nix) -&& builtins.pathExists (builtins.toPath (builtins.toString ./lib.nix)) -&& !builtins.pathExists (builtins.toPath (builtins.toString ./bla.nix)) -&& builtins.pathExists ./lib.nix -&& !builtins.pathExists ./bla.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-regex-split.exp b/tvix/eval/src/tests/nix_tests/eval-okay-regex-split.exp deleted file mode 100644 index 27ba77ddaf61..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-regex-split.exp +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-regex-split.nix b/tvix/eval/src/tests/nix_tests/eval-okay-regex-split.nix deleted file mode 100644 index 0073e057787d..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-regex-split.nix +++ /dev/null @@ -1,48 +0,0 @@ -with builtins; - -# Non capturing regex returns empty lists -assert split "foobar" "foobar" == ["" [] ""]; -assert split "fo*" "f" == ["" [] ""]; -assert split "fo+" "f" == ["f"]; -assert split "fo*" "fo" == ["" [] ""]; -assert split "fo*" "foo" == ["" [] ""]; -assert split "fo+" "foo" == ["" [] ""]; -assert split "fo{1,2}" "foo" == ["" [] ""]; -assert split "fo{1,2}" "fooo" == ["" [] "o"]; -assert split "fo*" "foobar" == ["" [] "bar"]; - -# Capturing regex returns a list of sub-matches -assert split "(fo*)" "f" == ["" ["f"] ""]; -assert split "(fo+)" "f" == ["f"]; -assert split "(fo*)" "fo" == ["" ["fo"] ""]; -assert split "(f)(o*)" "f" == ["" ["f" ""] ""]; -assert split "(f)(o*)" "foo" == ["" ["f" "oo"] ""]; -assert split "(fo+)" "foo" == ["" ["foo"] ""]; -assert split "(fo{1,2})" "foo" == ["" ["foo"] ""]; -assert split "(fo{1,2})" "fooo" == ["" ["foo"] "o"]; -assert split "(fo*)" "foobar" == ["" ["foo"] "bar"]; - -# Matches are greedy. -assert split "(o+)" "oooofoooo" == ["" ["oooo"] "f" ["oooo"] ""]; - -# Matches multiple times. -assert split "(b)" "foobarbaz" == ["foo" ["b"] "ar" ["b"] "az"]; - -# Split large strings containing newlines. null are inserted when a -# pattern within the current did not match anything. -assert split "[[:space:]]+|([',.!?])" '' - Nix Rocks! - That's why I use it. -'' == [ - "Nix" [ null ] "Rocks" ["!"] "" [ null ] - "That" ["'"] "s" [ null ] "why" [ null ] "I" [ null ] "use" [ null ] "it" ["."] "" [ null ] - "" -]; - -# Documentation examples -assert split "(a)b" "abc" == [ "" [ "a" ] "c" ]; -assert split "([ac])" "abc" == [ "" [ "a" ] "b" [ "c" ] "" ]; -assert split "(a)|(c)" "abc" == [ "" [ "a" null ] "b" [ null "c" ] "" ]; -assert split "([[:upper:]]+)" " FOO " == [ " " [ "FOO" ] " " ]; - -true diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.exp b/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.exp deleted file mode 100644 index 72e8274d8c58..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.exp +++ /dev/null @@ -1 +0,0 @@ -[ "faabar" "fbar" "fubar" "faboor" "fubar" "XaXbXcX" "X" "a_b" ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.nix b/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.nix deleted file mode 100644 index bd8031fc004e..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.nix +++ /dev/null @@ -1,11 +0,0 @@ -with builtins; - -[ (replaceStrings ["o"] ["a"] "foobar") - (replaceStrings ["o"] [""] "foobar") - (replaceStrings ["oo"] ["u"] "foobar") - (replaceStrings ["oo" "a"] ["a" "oo"] "foobar") - (replaceStrings ["oo" "oo"] ["u" "i"] "foobar") - (replaceStrings [""] ["X"] "abc") - (replaceStrings [""] ["X"] "") - (replaceStrings ["-"] ["_"] "a-b") -] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.exp b/tvix/eval/src/tests/nix_tests/eval-okay-search-path.exp deleted file mode 100644 index 4519bc406db5..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.exp +++ /dev/null @@ -1 +0,0 @@ -"abccX" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.flags b/tvix/eval/src/tests/nix_tests/eval-okay-search-path.flags deleted file mode 100644 index a28e6821004a..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.flags +++ /dev/null @@ -1 +0,0 @@ --I lang/dir1 -I lang/dir2 -I dir5=lang/dir3 \ No newline at end of file diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.nix b/tvix/eval/src/tests/nix_tests/eval-okay-search-path.nix deleted file mode 100644 index cca41f821f83..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.nix +++ /dev/null @@ -1,11 +0,0 @@ -with import ./lib.nix; -with builtins; - -assert pathExists ; - -assert length __nixPath == 6; -assert length (filter (x: x.prefix == "nix") __nixPath) == 1; -assert length (filter (x: baseNameOf x.path == "dir4") __nixPath) == 1; - -import + import + import + import - + (let __nixPath = [ { path = ./dir2; } { path = ./dir1; } ]; in import ) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-sort.exp b/tvix/eval/src/tests/nix_tests/eval-okay-sort.exp deleted file mode 100644 index 148b93516394..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-sort.exp +++ /dev/null @@ -1 +0,0 @@ -[ [ 42 77 147 249 483 526 ] [ 526 483 249 147 77 42 ] [ "bar" "fnord" "foo" "xyzzy" ] [ { key = 1; value = "foo"; } { key = 1; value = "fnord"; } { key = 2; value = "bar"; } ] ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix b/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix deleted file mode 100644 index 8299c3a4a3aa..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix +++ /dev/null @@ -1,8 +0,0 @@ -with builtins; - -[ (sort lessThan [ 483 249 526 147 42 77 ]) - (sort (x: y: y < x) [ 483 249 526 147 42 77 ]) - (sort lessThan [ "foo" "bar" "xyzzy" "fnord" ]) - (sort (x: y: x.key < y.key) - [ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ]) -] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp b/tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp new file mode 100644 index 000000000000..f7393e847d34 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp @@ -0,0 +1 @@ +100000 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp-disabled b/tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp-disabled deleted file mode 100644 index f7393e847d34..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-tail-call-1.exp-disabled +++ /dev/null @@ -1 +0,0 @@ -100000 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-tojson.exp b/tvix/eval/src/tests/nix_tests/eval-okay-tojson.exp deleted file mode 100644 index e92aae3235f2..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-tojson.exp +++ /dev/null @@ -1 +0,0 @@ -"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44,\"k\":\"foo\"}" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-tojson.nix b/tvix/eval/src/tests/nix_tests/eval-okay-tojson.nix deleted file mode 100644 index ce67943bead5..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-tojson.nix +++ /dev/null @@ -1,13 +0,0 @@ -builtins.toJSON - { a = 123; - b = -456; - c = "foo"; - d = "foo\n\"bar\""; - e = true; - f = false; - g = [ 1 2 3 ]; - h = [ "a" [ "b" { "foo\nbar" = {}; } ] ]; - i = 1 + 2; - j = 1.44; - k = { __toString = self: self.a; a = "foo"; }; - } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-toxml.exp b/tvix/eval/src/tests/nix_tests/eval-okay-toxml.exp deleted file mode 100644 index 828220890ecd..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-toxml.exp +++ /dev/null @@ -1 +0,0 @@ -"\n\n \n \n \n \n \n\n" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-toxml.nix b/tvix/eval/src/tests/nix_tests/eval-okay-toxml.nix deleted file mode 100644 index 068c97a6c1b3..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-toxml.nix +++ /dev/null @@ -1,3 +0,0 @@ -# Make sure the expected XML output is produced; in particular, make sure it -# doesn't contain source location information. -builtins.toXML { a = "s"; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-toxml2.exp b/tvix/eval/src/tests/nix_tests/eval-okay-toxml2.exp deleted file mode 100644 index 634a841eb190..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-toxml2.exp +++ /dev/null @@ -1 +0,0 @@ -"\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-toxml2.nix b/tvix/eval/src/tests/nix_tests/eval-okay-toxml2.nix deleted file mode 100644 index ff1791b30eb5..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-toxml2.nix +++ /dev/null @@ -1 +0,0 @@ -builtins.toXML [("a" + "b") 10 (rec {x = "x"; y = x;})] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-xml.exp.xml b/tvix/eval/src/tests/nix_tests/eval-okay-xml.exp.xml deleted file mode 100644 index 92b75e0b8b17..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-xml.exp.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-xml.nix b/tvix/eval/src/tests/nix_tests/eval-okay-xml.nix deleted file mode 100644 index 9ee9f8a0b4f5..000000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-xml.nix +++ /dev/null @@ -1,21 +0,0 @@ -rec { - - x = 123; - - y = 567.890; - - a = "foo"; - - b = "bar"; - - c = "foo" + "bar"; - - f = {z, x, y}: if y then x else z; - - id = x: x; - - at = args@{x, y, z}: x; - - ellipsis = {x, y, z, ...}: x; - -} diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-antiquoted-path.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-antiquoted-path.nix new file mode 100644 index 000000000000..f2f08107b516 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-antiquoted-path.nix @@ -0,0 +1,4 @@ +# This must fail to evaluate, since ./fnord doesn't exist. If it did +# exist, it would produce "/nix/store/-fnord/xyzzy" (with an +# appropriate context). +"${./fnord}/xyzzy" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix new file mode 100644 index 000000000000..3745235ce95e --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix @@ -0,0 +1 @@ +"${./fnord}" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix new file mode 100644 index 000000000000..f89a65a99be3 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix @@ -0,0 +1,10 @@ +let { + + x = "a"; + y = "b"; + + f = {x ? y, y ? x}: x + y; + + body = f {}; + +} diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix new file mode 100644 index 000000000000..cafdf1636272 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix @@ -0,0 +1 @@ +({x, z}: x + z) {x = "foo"; y = "bla"; z = "bar";} diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp new file mode 100644 index 000000000000..b46938032e73 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp @@ -0,0 +1 @@ +{ __overrides = { bar = "qux"; }; bar = "qux"; foo = "bar"; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix new file mode 100644 index 000000000000..2e5c85483be6 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix @@ -0,0 +1,4 @@ +rec { + "${"foo"}" = "bar"; + __overrides = { bar = "qux"; }; +} diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp new file mode 100644 index 000000000000..7a8391786a09 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp @@ -0,0 +1 @@ +"xyzzy!xyzzy!foobar" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags new file mode 100644 index 000000000000..217c7a5ae291 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags @@ -0,0 +1 @@ +--arg lib import(nix_tests/lib.nix) --argstr xyzzy xyzzy! -A result diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.nix new file mode 100644 index 000000000000..815f51b1d67a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.nix @@ -0,0 +1,15 @@ +let + + foobar = "foobar"; + +in + +{ xyzzy2 ? xyzzy # mutually recursive args +, xyzzy ? "blaat" # will be overridden by --argstr +, fb ? foobar +, lib # will be set by --arg +}: + +{ + result = lib.concat [xyzzy xyzzy2 fb]; +} diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp new file mode 100644 index 000000000000..0661686d611d --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.exp @@ -0,0 +1 @@ +/foo diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix new file mode 100644 index 000000000000..e9d65e88a817 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-builtins.nix @@ -0,0 +1,12 @@ +assert builtins ? currentSystem; +assert !builtins ? __currentSystem; + +let { + + x = if builtins ? dirOf then builtins.dirOf /foo/bar else ""; + + y = if builtins ? fnord then builtins.fnord "foo" else ""; + + body = x + y; + +} diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.exp new file mode 100644 index 000000000000..dffc03a99891 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.exp @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.nix new file mode 100644 index 000000000000..cccd4dc35730 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-closure.nix @@ -0,0 +1,13 @@ +let + + closure = builtins.genericClosure { + startSet = [{key = 80;}]; + operator = {key, foo ? false}: + if builtins.lessThan key 0 + then [] + else [{key = builtins.sub key 9;} {key = builtins.sub key 13; foo = true;}]; + }; + + sort = (import ./lib.nix).sortBy (a: b: builtins.lessThan a.key b.key); + +in sort closure diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.exp new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.exp @@ -0,0 +1 @@ +true diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.nix new file mode 100644 index 000000000000..43178bd2eef9 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.nix @@ -0,0 +1,24 @@ +let + drv = derivation { + name = "fail"; + builder = "/bin/false"; + system = "x86_64-linux"; + outputs = [ "out" "foo" ]; + }; + + path = "${./eval-okay-context-introspection.nix}"; + + desired-context = { + "${builtins.unsafeDiscardStringContext path}" = { + path = true; + }; + "${builtins.unsafeDiscardStringContext drv.drvPath}" = { + outputs = [ "foo" "out" ]; + allOutputs = true; + }; + }; + + legit-context = builtins.getContext "${path}${drv.outPath}${drv.foo.outPath}${drv.drvPath}"; + + constructed-context = builtins.getContext (builtins.appendContext "" desired-context); +in legit-context == constructed-context diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp new file mode 100644 index 000000000000..2f535bdbc454 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp @@ -0,0 +1 @@ +"foo eval-okay-context.nix bar" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix new file mode 100644 index 000000000000..7b9531cfe9e1 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix @@ -0,0 +1,6 @@ +let s = "foo ${builtins.substring 33 100 (baseNameOf "${./eval-okay-context.nix}")} bar"; +in + if s != "foo eval-okay-context.nix bar" + then abort "context not discarded" + else builtins.unsafeDiscardStringContext s + diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp new file mode 100644 index 000000000000..65fd65b4d01f --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp @@ -0,0 +1 @@ +[ 3 7 4 9 ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix new file mode 100644 index 000000000000..b79553df0bd3 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix @@ -0,0 +1,5 @@ +# Bla +let + x = __curPos; + y = __curPos; +in [ x.line x.column y.line y.column ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.exp new file mode 100644 index 000000000000..8d38505c1686 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.exp @@ -0,0 +1 @@ +456 diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.nix new file mode 100644 index 000000000000..53aa4b1dc251 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-deepseq.nix @@ -0,0 +1 @@ +builtins.deepSeq (let as = { x = 123; y = as; }; in as) 456 diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.exp new file mode 100644 index 000000000000..eaacb55c1aff --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.exp @@ -0,0 +1 @@ +"b-overridden" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.nix new file mode 100644 index 000000000000..84b388c27130 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with-inherit.nix @@ -0,0 +1,24 @@ +let + pkgs_ = with pkgs; { + a = derivation { + name = "a"; + system = builtins.currentSystem; + builder = "/bin/sh"; + args = [ "-c" "touch $out" ]; + inherit b; + }; + + inherit b; + }; + + packageOverrides = p: { + b = derivation { + name = "b-overridden"; + system = builtins.currentSystem; + builder = "/bin/sh"; + args = [ "-c" "touch $out" ]; + }; + }; + + pkgs = pkgs_ // (packageOverrides pkgs_); +in pkgs.a.b.name diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp new file mode 100644 index 000000000000..8e7c61ab8e77 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp @@ -0,0 +1 @@ +"b-overridden b-overridden a" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.nix new file mode 100644 index 000000000000..3fb023e1cd42 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.nix @@ -0,0 +1,29 @@ +let + + pkgs_ = with pkgs; { + a = derivation { + name = "a"; + system = builtins.currentSystem; + builder = "/bin/sh"; + args = [ "-c" "touch $out" ]; + inherit b; + }; + + b = derivation { + name = "b"; + system = builtins.currentSystem; + builder = "/bin/sh"; + args = [ "-c" "touch $out" ]; + inherit a; + }; + + c = b; + }; + + packageOverrides = pkgs: with pkgs; { + b = derivation (b.drvAttrs // { name = "${b.name}-overridden"; }); + }; + + pkgs = pkgs_ // (packageOverrides pkgs_); + +in "${pkgs.a.b.name} ${pkgs.c.name} ${pkgs.b.a.name}" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp new file mode 100644 index 000000000000..ec04aab6aeec --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp @@ -0,0 +1 @@ +[ true true true false ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.nix new file mode 100644 index 000000000000..d526cb4a2161 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.nix @@ -0,0 +1,10 @@ +let + + drvA1 = derivation { name = "a"; builder = "/foo"; system = "i686-linux"; }; + drvA2 = derivation { name = "a"; builder = "/foo"; system = "i686-linux"; }; + drvA3 = derivation { name = "a"; builder = "/foo"; system = "i686-linux"; } // { dummy = 1; }; + + drvC1 = derivation { name = "c"; builder = "/foo"; system = "i686-linux"; }; + drvC2 = derivation { name = "c"; builder = "/bar"; system = "i686-linux"; }; + +in [ (drvA1 == drvA1) (drvA1 == drvA2) (drvA1 == drvA3) (drvC1 == drvC2) ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.exp new file mode 100644 index 000000000000..2015847b65e7 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.exp @@ -0,0 +1 @@ +Bool(True) diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.nix new file mode 100644 index 000000000000..73d200b38141 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq.nix @@ -0,0 +1,3 @@ +["foobar" (rec {x = 1; y = x;})] +== +[("foo" + "bar") ({x = 1; y = 1;})] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp new file mode 100644 index 000000000000..d0dd3af2c814 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp @@ -0,0 +1 @@ +[ { clients = { data = [ [ "gamma" "delta" ] [ 1 2 ] ]; hosts = [ "alpha" "omega" ]; }; database = { connection_max = 5000; enabled = true; ports = [ 8001 8001 8002 ]; server = "192.168.1.1"; }; owner = { name = "Tom Preston-Werner"; }; servers = { alpha = { dc = "eqdc10"; ip = "10.0.0.1"; }; beta = { dc = "eqdc10"; ip = "10.0.0.2"; }; }; title = "TOML Example"; } { "1234" = "value"; "127.0.0.1" = "value"; a = { b = { c = { }; }; }; arr1 = [ 1 2 3 ]; arr2 = [ "red" "yellow" "green" ]; arr3 = [ [ 1 2 ] [ 3 4 5 ] ]; arr4 = [ "all" "strings" "are the same" "type" ]; arr5 = [ [ 1 2 ] [ "a" "b" "c" ] ]; arr7 = [ 1 2 3 ]; arr8 = [ 1 2 ]; bare-key = "value"; bare_key = "value"; bin1 = 214; bool1 = true; bool2 = false; "character encoding" = "value"; d = { e = { f = { }; }; }; dog = { "tater.man" = { type = { name = "pug"; }; }; }; flt1 = 1; flt2 = 3.1415; flt3 = -0.01; flt4 = 5e+22; flt5 = 1e+06; flt6 = -0.02; flt7 = 6.626e-34; flt8 = 9.22462e+06; fruit = [ { name = "apple"; physical = { color = "red"; shape = "round"; }; variety = [ { name = "red delicious"; } { name = "granny smith"; } ]; } { name = "banana"; variety = [ { name = "plantain"; } ]; } ]; g = { h = { i = { }; }; }; hex1 = 3735928559; hex2 = 3735928559; hex3 = 3735928559; int1 = 99; int2 = 42; int3 = 0; int4 = -17; int5 = 1000; int6 = 5349221; int7 = 12345; j = { "ʞ" = { l = { }; }; }; key = "value"; key2 = "value"; name = "Orange"; oct1 = 342391; oct2 = 493; physical = { color = "orange"; shape = "round"; }; products = [ { name = "Hammer"; sku = 738594937; } { } { color = "gray"; name = "Nail"; sku = 284758393; } ]; "quoted \"value\"" = "value"; site = { "google.com" = true; }; str = "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."; table-1 = { key1 = "some string"; key2 = 123; }; table-2 = { key1 = "another string"; key2 = 456; }; x = { y = { z = { w = { animal = { type = { name = "pug"; }; }; name = { first = "Tom"; last = "Preston-Werner"; }; point = { x = 1; y = 2; }; }; }; }; }; "ʎǝʞ" = "value"; } { metadata = { "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"; "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"; "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"; "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"; }; package = [ { dependencies = [ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "aho-corasick"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.6.4"; } { name = "ansi_term"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.9.0"; } { dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "atty"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.2.10"; } ]; } { a = [ [ { b = true; } ] ]; c = [ [ { d = true; } ] ]; e = [ [ 123 ] ]; } ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix new file mode 100644 index 000000000000..963932689942 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix @@ -0,0 +1,208 @@ +[ + + (builtins.fromTOML '' + # This is a TOML document. + + title = "TOML Example" + + [owner] + name = "Tom Preston-Werner" + #dob = 1979-05-27T07:32:00-08:00 # First class dates + + [database] + server = "192.168.1.1" + ports = [ 8001, 8001, 8002 ] + connection_max = 5000 + enabled = true + + [servers] + + # Indentation (tabs and/or spaces) is allowed but not required + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + + [clients] + data = [ ["gamma", "delta"], [1, 2] ] + + # Line breaks are OK when inside arrays + hosts = [ + "alpha", + "omega" + ] + '') + + (builtins.fromTOML '' + key = "value" + bare_key = "value" + bare-key = "value" + 1234 = "value" + + "127.0.0.1" = "value" + "character encoding" = "value" + "ʎǝʞ" = "value" + 'key2' = "value" + 'quoted "value"' = "value" + + name = "Orange" + + physical.color = "orange" + physical.shape = "round" + site."google.com" = true + + # This is legal according to the spec, but cpptoml doesn't handle it. + #a.b.c = 1 + #a.d = 2 + + str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." + + int1 = +99 + int2 = 42 + int3 = 0 + int4 = -17 + int5 = 1_000 + int6 = 5_349_221 + int7 = 1_2_3_4_5 + + hex1 = 0xDEADBEEF + hex2 = 0xdeadbeef + hex3 = 0xdead_beef + + oct1 = 0o01234567 + oct2 = 0o755 + + bin1 = 0b11010110 + + flt1 = +1.0 + flt2 = 3.1415 + flt3 = -0.01 + flt4 = 5e+22 + flt5 = 1e6 + flt6 = -2E-2 + flt7 = 6.626e-34 + flt8 = 9_224_617.445_991_228_313 + + bool1 = true + bool2 = false + + # FIXME: not supported because Nix doesn't have a date/time type. + #odt1 = 1979-05-27T07:32:00Z + #odt2 = 1979-05-27T00:32:00-07:00 + #odt3 = 1979-05-27T00:32:00.999999-07:00 + #odt4 = 1979-05-27 07:32:00Z + #ldt1 = 1979-05-27T07:32:00 + #ldt2 = 1979-05-27T00:32:00.999999 + #ld1 = 1979-05-27 + #lt1 = 07:32:00 + #lt2 = 00:32:00.999999 + + arr1 = [ 1, 2, 3 ] + arr2 = [ "red", "yellow", "green" ] + arr3 = [ [ 1, 2 ], [3, 4, 5] ] + arr4 = [ "all", 'strings', """are the same""", ''''type''''] + arr5 = [ [ 1, 2 ], ["a", "b", "c"] ] + + arr7 = [ + 1, 2, 3 + ] + + arr8 = [ + 1, + 2, # this is ok + ] + + [table-1] + key1 = "some string" + key2 = 123 + + + [table-2] + key1 = "another string" + key2 = 456 + + [dog."tater.man"] + type.name = "pug" + + [a.b.c] + [ d.e.f ] + [ g . h . i ] + [ j . "ʞ" . 'l' ] + [x.y.z.w] + + name = { first = "Tom", last = "Preston-Werner" } + point = { x = 1, y = 2 } + animal = { type.name = "pug" } + + [[products]] + name = "Hammer" + sku = 738594937 + + [[products]] + + [[products]] + name = "Nail" + sku = 284758393 + color = "gray" + + [[fruit]] + name = "apple" + + [fruit.physical] + color = "red" + shape = "round" + + [[fruit.variety]] + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + + [[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" + '') + + (builtins.fromTOML '' + [[package]] + name = "aho-corasick" + version = "0.6.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] + name = "ansi_term" + version = "0.9.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "atty" + version = "0.2.10" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [metadata] + "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" + "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" + "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" + "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" + '') + + (builtins.fromTOML '' + a = [[{ b = true }]] + c = [ [ { d = true } ] ] + e = [[123]] + '') + +] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.exp new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.exp @@ -0,0 +1 @@ +true diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.nix new file mode 100644 index 000000000000..102ee82b5e6b --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromjson.nix @@ -0,0 +1,36 @@ +# RFC 7159, section 13. +builtins.fromJSON + '' + { + "Image": { + "Width": 800, + "Height": 600, + "Title": "View from 15th Floor", + "Thumbnail": { + "Url": "http://www.example.com/image/481989943", + "Height": 125, + "Width": 100 + }, + "Animated" : false, + "IDs": [116, 943, 234, 38793, true ,false,null, -100], + "Latitude": 37.7668, + "Longitude": -122.3959 + } + } + '' +== + { Image = + { Width = 800; + Height = 600; + Title = "View from 15th Floor"; + Thumbnail = + { Url = http://www.example.com/image/481989943; + Height = 125; + Width = 100; + }; + Animated = false; + IDs = [ 116 943 234 38793 true false null (0-100) ]; + Latitude = 37.7668; + Longitude = -122.3959; + }; + } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.exp new file mode 100644 index 000000000000..651f54c36341 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.exp @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.nix new file mode 100644 index 000000000000..68dca62ee18d --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-functionargs.nix @@ -0,0 +1,80 @@ +let + + stdenvFun = { }: { name = "stdenv"; }; + stdenv2Fun = { }: { name = "stdenv2"; }; + fetchurlFun = { stdenv }: assert stdenv.name == "stdenv"; { name = "fetchurl"; }; + atermFun = { stdenv, fetchurl }: { name = "aterm-${stdenv.name}"; }; + aterm2Fun = { stdenv, fetchurl }: { name = "aterm2-${stdenv.name}"; }; + nixFun = { stdenv, fetchurl, aterm }: { name = "nix-${stdenv.name}-${aterm.name}"; }; + + mplayerFun = + { stdenv, fetchurl, enableX11 ? false, xorg ? null, enableFoo ? true, foo ? null }: + assert stdenv.name == "stdenv2"; + assert enableX11 -> xorg.libXv.name == "libXv"; + assert enableFoo -> foo != null; + { name = "mplayer-${stdenv.name}.${xorg.libXv.name}-${xorg.libX11.name}"; }; + + makeOverridable = f: origArgs: f origArgs // + { override = newArgs: + makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs)); + }; + + callPackage_ = pkgs: f: args: + makeOverridable f ((builtins.intersectAttrs (builtins.functionArgs f) pkgs) // args); + + allPackages = + { overrides ? (pkgs: pkgsPrev: { }) }: + let + callPackage = callPackage_ pkgs; + pkgs = pkgsStd // (overrides pkgs pkgsStd); + pkgsStd = { + inherit pkgs; + stdenv = callPackage stdenvFun { }; + stdenv2 = callPackage stdenv2Fun { }; + fetchurl = callPackage fetchurlFun { }; + aterm = callPackage atermFun { }; + xorg = callPackage xorgFun { }; + mplayer = callPackage mplayerFun { stdenv = pkgs.stdenv2; enableFoo = false; }; + nix = callPackage nixFun { }; + }; + in pkgs; + + libX11Fun = { stdenv, fetchurl }: { name = "libX11"; }; + libX11_2Fun = { stdenv, fetchurl }: { name = "libX11_2"; }; + libXvFun = { stdenv, fetchurl, libX11 }: { name = "libXv"; }; + + xorgFun = + { pkgs }: + let callPackage = callPackage_ (pkgs // pkgs.xorg); in + { + libX11 = callPackage libX11Fun { }; + libXv = callPackage libXvFun { }; + }; + +in + +let + + pkgs = allPackages { }; + + pkgs2 = allPackages { + overrides = pkgs: pkgsPrev: { + stdenv = pkgs.stdenv2; + nix = pkgsPrev.nix.override { aterm = aterm2Fun { inherit (pkgs) stdenv fetchurl; }; }; + xorg = pkgsPrev.xorg // { libX11 = libX11_2Fun { inherit (pkgs) stdenv fetchurl; }; }; + }; + }; + +in + + [ pkgs.stdenv.name + pkgs.fetchurl.name + pkgs.aterm.name + pkgs2.aterm.name + pkgs.xorg.libX11.name + pkgs.xorg.libXv.name + pkgs.mplayer.name + pkgs2.mplayer.name + pkgs.nix.name + pkgs2.nix.name + ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp new file mode 100644 index 000000000000..19765bd501b6 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp @@ -0,0 +1 @@ +null diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix new file mode 100644 index 000000000000..14dd38f7734c --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix @@ -0,0 +1 @@ +builtins.unsafeGetAttrPos "abort" builtins diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp new file mode 100644 index 000000000000..469249bbc646 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp @@ -0,0 +1 @@ +{ column = 5; file = "eval-okay-getattrpos.nix"; line = 3; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix new file mode 100644 index 000000000000..ca6b07961547 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix @@ -0,0 +1,6 @@ +let + as = { + foo = "bar"; + }; + pos = builtins.unsafeGetAttrPos "foo" as; +in { inherit (pos) column line; file = baseNameOf pos.file; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.exp new file mode 100644 index 000000000000..14e24d419005 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.exp @@ -0,0 +1 @@ +"foobar" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.nix new file mode 100644 index 000000000000..4cfec5f553d9 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getenv.nix @@ -0,0 +1 @@ +builtins.getEnv "TEST_VAR" + (if builtins.getEnv "NO_SUCH_VAR" == "" then "bar" else "bla") diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.exp new file mode 100644 index 000000000000..ff1e8293ef22 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.exp @@ -0,0 +1 @@ +[ "d3b07384d113edec49eaa6238ad5ff00" "0f343b0931126a20f133d67c2b018a3b" "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15" "60cacbf3d72e1e7834203da608037b1bf83b40e8" "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c" "5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" "0cf9180a764aba863a67b6d72f0918bc131c6772642cb2dce5a34f0a702f9470ddc2bf125c12198b1995c233c34b4afd346c54a2334c350a948a51b6e8b4e6b6" "8efb4f73c5655351c444eb109230c556d39e2c7624e9c11abc9e3fb4b9b9254218cc5085b454a9698d085cfa92198491f07a723be4574adc70617b73eb0b6461" ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.nix new file mode 100644 index 000000000000..aff5a1856814 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashfile.nix @@ -0,0 +1,4 @@ +let + paths = [ ./data ./binary-data ]; +in + builtins.concatLists (map (hash: map (builtins.hashFile hash) paths) ["md5" "sha1" "sha256" "sha512"]) diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.exp new file mode 100644 index 000000000000..d720a082ddb3 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.exp @@ -0,0 +1 @@ +[ "d41d8cd98f00b204e9800998ecf8427e" "6c69ee7f211c640419d5366cc076ae46" "bb3438fbabd460ea6dbd27d153e2233b" "da39a3ee5e6b4b0d3255bfef95601890afd80709" "cd54e8568c1b37cf1e5badb0779bcbf382212189" "6d12e10b1d331dad210e47fd25d4f260802b7e77" "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" "900a4469df00ccbfd0c145c6d1e4b7953dd0afafadd7534e3a4019e8d38fc663" "ad0387b3bd8652f730ca46d25f9c170af0fd589f42e7f23f5a9e6412d97d7e56" "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" "9d0886f8c6b389398a16257bc79780fab9831c7fc11c8ab07fa732cb7b348feade382f92617c9c5305fefba0af02ab5fd39a587d330997ff5bd0db19f7666653" "21644b72aa259e5a588cd3afbafb1d4310f4889680f6c83b9d531596a5a284f34dbebff409d23bcc86aee6bad10c891606f075c6f4755cb536da27db5693f3a7" ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.nix new file mode 100644 index 000000000000..b0f62b245ca8 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-hashstring.nix @@ -0,0 +1,4 @@ +let + strings = [ "" "text 1" "text 2" ]; +in + builtins.concatLists (map (hash: map (builtins.hashString hash) strings) ["md5" "sha1" "sha256" "sha512"]) diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp new file mode 100644 index 000000000000..c508125b55be --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp @@ -0,0 +1 @@ +[ 1 2 3 4 5 6 7 8 9 10 ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.nix new file mode 100644 index 000000000000..0b18d9413122 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.nix @@ -0,0 +1,11 @@ +let + + overrides = { + import = fn: scopedImport overrides fn; + + scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; + + builtins = builtins // overrides; + } // import ./lib.nix; + +in scopedImport overrides ./imported.nix diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.exp new file mode 100644 index 000000000000..3f113f17bab1 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.exp @@ -0,0 +1 @@ +{ x = "x-foo"; y = "y-bar"; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.nix new file mode 100644 index 000000000000..f075b6275e5a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-mapattrs.nix @@ -0,0 +1,3 @@ +with import ./lib.nix; + +builtins.mapAttrs (name: value: name + "-" + value) { x = "foo"; y = "bar"; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp @@ -0,0 +1 @@ +2 diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix new file mode 100644 index 000000000000..358742b36e22 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix @@ -0,0 +1,9 @@ +let + + overrides = { a = 2; }; + +in (rec { + __overrides = overrides; + x = a; + a = 1; +}).x diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix new file mode 100644 index 000000000000..e67168cf3edf --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix @@ -0,0 +1,7 @@ +builtins.path + { path = ./.; + filter = path: _: baseNameOf path == "data"; + recursive = true; + sha256 = "1yhm3gwvg5a41yylymgblsclk95fs6jy72w0wv925mmidlhcq4sw"; + name = "output"; + } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.exp new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.exp @@ -0,0 +1 @@ +true diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.nix new file mode 100644 index 000000000000..50c28ee0cd30 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-pathexists.nix @@ -0,0 +1,5 @@ +builtins.pathExists (builtins.toPath ./lib.nix) +&& builtins.pathExists (builtins.toPath (builtins.toString ./lib.nix)) +&& !builtins.pathExists (builtins.toPath (builtins.toString ./bla.nix)) +&& builtins.pathExists ./lib.nix +&& !builtins.pathExists ./bla.nix diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.exp new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.exp @@ -0,0 +1 @@ +true diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.nix new file mode 100644 index 000000000000..0073e057787d --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-regex-split.nix @@ -0,0 +1,48 @@ +with builtins; + +# Non capturing regex returns empty lists +assert split "foobar" "foobar" == ["" [] ""]; +assert split "fo*" "f" == ["" [] ""]; +assert split "fo+" "f" == ["f"]; +assert split "fo*" "fo" == ["" [] ""]; +assert split "fo*" "foo" == ["" [] ""]; +assert split "fo+" "foo" == ["" [] ""]; +assert split "fo{1,2}" "foo" == ["" [] ""]; +assert split "fo{1,2}" "fooo" == ["" [] "o"]; +assert split "fo*" "foobar" == ["" [] "bar"]; + +# Capturing regex returns a list of sub-matches +assert split "(fo*)" "f" == ["" ["f"] ""]; +assert split "(fo+)" "f" == ["f"]; +assert split "(fo*)" "fo" == ["" ["fo"] ""]; +assert split "(f)(o*)" "f" == ["" ["f" ""] ""]; +assert split "(f)(o*)" "foo" == ["" ["f" "oo"] ""]; +assert split "(fo+)" "foo" == ["" ["foo"] ""]; +assert split "(fo{1,2})" "foo" == ["" ["foo"] ""]; +assert split "(fo{1,2})" "fooo" == ["" ["foo"] "o"]; +assert split "(fo*)" "foobar" == ["" ["foo"] "bar"]; + +# Matches are greedy. +assert split "(o+)" "oooofoooo" == ["" ["oooo"] "f" ["oooo"] ""]; + +# Matches multiple times. +assert split "(b)" "foobarbaz" == ["foo" ["b"] "ar" ["b"] "az"]; + +# Split large strings containing newlines. null are inserted when a +# pattern within the current did not match anything. +assert split "[[:space:]]+|([',.!?])" '' + Nix Rocks! + That's why I use it. +'' == [ + "Nix" [ null ] "Rocks" ["!"] "" [ null ] + "That" ["'"] "s" [ null ] "why" [ null ] "I" [ null ] "use" [ null ] "it" ["."] "" [ null ] + "" +]; + +# Documentation examples +assert split "(a)b" "abc" == [ "" [ "a" ] "c" ]; +assert split "([ac])" "abc" == [ "" [ "a" ] "b" [ "c" ] "" ]; +assert split "(a)|(c)" "abc" == [ "" [ "a" null ] "b" [ null "c" ] "" ]; +assert split "([[:upper:]]+)" " FOO " == [ " " [ "FOO" ] " " ]; + +true diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.exp new file mode 100644 index 000000000000..72e8274d8c58 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.exp @@ -0,0 +1 @@ +[ "faabar" "fbar" "fubar" "faboor" "fubar" "XaXbXcX" "X" "a_b" ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.nix new file mode 100644 index 000000000000..bd8031fc004e --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.nix @@ -0,0 +1,11 @@ +with builtins; + +[ (replaceStrings ["o"] ["a"] "foobar") + (replaceStrings ["o"] [""] "foobar") + (replaceStrings ["oo"] ["u"] "foobar") + (replaceStrings ["oo" "a"] ["a" "oo"] "foobar") + (replaceStrings ["oo" "oo"] ["u" "i"] "foobar") + (replaceStrings [""] ["X"] "abc") + (replaceStrings [""] ["X"] "") + (replaceStrings ["-"] ["_"] "a-b") +] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp new file mode 100644 index 000000000000..4519bc406db5 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp @@ -0,0 +1 @@ +"abccX" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags new file mode 100644 index 000000000000..a28e6821004a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags @@ -0,0 +1 @@ +-I lang/dir1 -I lang/dir2 -I dir5=lang/dir3 \ No newline at end of file diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.nix new file mode 100644 index 000000000000..cca41f821f83 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.nix @@ -0,0 +1,11 @@ +with import ./lib.nix; +with builtins; + +assert pathExists ; + +assert length __nixPath == 6; +assert length (filter (x: x.prefix == "nix") __nixPath) == 1; +assert length (filter (x: baseNameOf x.path == "dir4") __nixPath) == 1; + +import + import + import + import + + (let __nixPath = [ { path = ./dir2; } { path = ./dir1; } ]; in import ) diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.exp new file mode 100644 index 000000000000..148b93516394 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.exp @@ -0,0 +1 @@ +[ [ 42 77 147 249 483 526 ] [ 526 483 249 147 77 42 ] [ "bar" "fnord" "foo" "xyzzy" ] [ { key = 1; value = "foo"; } { key = 1; value = "fnord"; } { key = 2; value = "bar"; } ] ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.nix new file mode 100644 index 000000000000..8299c3a4a3aa --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-sort.nix @@ -0,0 +1,8 @@ +with builtins; + +[ (sort lessThan [ 483 249 526 147 42 77 ]) + (sort (x: y: y < x) [ 483 249 526 147 42 77 ]) + (sort lessThan [ "foo" "bar" "xyzzy" "fnord" ]) + (sort (x: y: x.key < y.key) + [ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ]) +] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.exp new file mode 100644 index 000000000000..e92aae3235f2 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.exp @@ -0,0 +1 @@ +"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44,\"k\":\"foo\"}" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.nix new file mode 100644 index 000000000000..ce67943bead5 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-tojson.nix @@ -0,0 +1,13 @@ +builtins.toJSON + { a = 123; + b = -456; + c = "foo"; + d = "foo\n\"bar\""; + e = true; + f = false; + g = [ 1 2 3 ]; + h = [ "a" [ "b" { "foo\nbar" = {}; } ] ]; + i = 1 + 2; + j = 1.44; + k = { __toString = self: self.a; a = "foo"; }; + } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.exp new file mode 100644 index 000000000000..828220890ecd --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.exp @@ -0,0 +1 @@ +"\n\n \n \n \n \n \n\n" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.nix new file mode 100644 index 000000000000..068c97a6c1b3 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml.nix @@ -0,0 +1,3 @@ +# Make sure the expected XML output is produced; in particular, make sure it +# doesn't contain source location information. +builtins.toXML { a = "s"; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.exp new file mode 100644 index 000000000000..634a841eb190 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.exp @@ -0,0 +1 @@ +"\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.nix new file mode 100644 index 000000000000..ff1791b30eb5 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-toxml2.nix @@ -0,0 +1 @@ +builtins.toXML [("a" + "b") 10 (rec {x = "x"; y = x;})] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.exp new file mode 100644 index 000000000000..92b75e0b8b17 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.exp @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.nix new file mode 100644 index 000000000000..9ee9f8a0b4f5 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-xml.nix @@ -0,0 +1,21 @@ +rec { + + x = 123; + + y = 567.890; + + a = "foo"; + + b = "bar"; + + c = "foo" + "bar"; + + f = {z, x, y}: if y then x else z; + + id = x: x; + + at = args@{x, y, z}: x; + + ellipsis = {x, y, z, ...}: x; + +} -- cgit 1.4.1