From d3534ee051abad5117e9578854b6cd13a14d940d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 15 Mar 2024 16:42:37 +0300 Subject: fix(depotfmt): only exclude *imported* tvix tests When we added the Nix language test suite in cl/6126, we excluded the whole tvix tests folder from Nix formatting. This is unintentional, as we probably want *our* tests to be formatted correctly. Change-Id: I2b66d79e30fae17e75d5a1f8c44e279886091c5f Reviewed-on: https://cl.tvl.fyi/c/depot/+/11154 Autosubmit: tazjin Reviewed-by: flokli Tested-by: BuildkiteCI --- .../tvix_tests/eval-fail-builtins-thunk-error.nix | 2 +- .../tests/tvix_tests/eval-fail-closed-formals.nix | 2 +- ...al-fail-force-before-value-pointer-equality.nix | 2 +- .../eval/src/tests/tvix_tests/eval-fail-remove.nix | 6 +- .../eval-okay-access-strange-identifier.nix | 3 +- .../eval-okay-assert-thunk-condition.nix | 2 +- .../tvix_tests/eval-okay-attrs-inherit-literal.nix | 2 +- .../eval-okay-attrs-update-empty-lhs.nix | 2 +- .../eval-okay-attrs-update-empty-rhs.nix | 2 +- .../eval-okay-basenameof-propagate-catchables.nix | 2 +- .../tvix_tests/eval-okay-builtins-attrnames.nix | 2 +- .../tvix_tests/eval-okay-builtins-attrvalues.nix | 2 +- .../tvix_tests/eval-okay-builtins-builtins.nix | 2 +- .../eval-okay-builtins-compareVersions.nix | 2 +- ...y-builtins-concat-lists-propagate-catchable.nix | 2 +- ...kay-builtins-concat-map-propagate-catchable.nix | 2 +- ...val-okay-builtins-foldl-propagate-catchable.nix | 12 +- ...ay-builtins-genericClosure-pointer-equality.nix | 10 +- .../eval-okay-builtins-groupby-thunk.nix | 1 - .../tvix_tests/eval-okay-builtins-hasattr.nix | 2 +- .../tests/tvix_tests/eval-okay-builtins-length.nix | 2 +- ...-builtins-list-to-attrs-propagate-catchable.nix | 8 +- .../tvix_tests/eval-okay-builtins-partition.nix | 6 +- ...y-builtins-remove-attrs-propagate-catchable.nix | 2 +- .../eval-okay-builtins-replaceStrings.nix | 8 +- .../eval-okay-builtins-thunked-function-calls.nix | 2 +- .../tvix_tests/eval-okay-builtins-type-of.nix | 32 +++--- .../eval-okay-builtins-type-predicates.nix | 4 +- .../eval-okay-catchable-in-intersectattrs.nix | 2 +- .../eval-okay-closure-pointer-compare.nix | 4 +- .../tests/tvix_tests/eval-okay-closure-self.nix | 3 +- .../eval-okay-closure-with-shadowing.nix | 4 +- .../tests/tvix_tests/eval-okay-coerce-opadd.nix | 4 +- .../tests/tvix_tests/eval-okay-compare-lists.nix | 30 ++--- .../src/tests/tvix_tests/eval-okay-concatmap.nix | 2 +- .../tvix_tests/eval-okay-concatstringssep.nix | 11 +- .../eval-okay-deeply-nested-with-closure.nix | 5 +- .../tests/tvix_tests/eval-okay-deferred-with.nix | 3 +- .../tests/tvix_tests/eval-okay-eq-nested-list.nix | 2 +- ...y-equality-tolerate-catchable-in-type-field.nix | 2 +- tvix/eval/src/tests/tvix_tests/eval-okay-fib.nix | 6 +- tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix | 3 +- .../src/tests/tvix_tests/eval-okay-foldlStrict.nix | 6 +- ...kay-formals-miscompilation-b-261-regression.nix | 2 +- .../src/tests/tvix_tests/eval-okay-fromjson.nix | 34 +++--- .../tests/tvix_tests/eval-okay-functionargs.nix | 43 ++++---- .../tvix_tests/eval-okay-inherit-string-ident.nix | 3 +- .../tests/tvix_tests/eval-okay-intersectattrs.nix | 4 +- .../tvix_tests/eval-okay-late-binding-closure.nix | 3 +- .../tests/tvix_tests/eval-okay-late-binding.nix | 3 +- .../tests/tvix_tests/eval-okay-lazy-equality.nix | 3 +- .../tests/tvix_tests/eval-okay-legacy-let-fix.nix | 12 +- .../tvix_tests/eval-okay-legacy-let-in-with.nix | 2 +- .../src/tests/tvix_tests/eval-okay-legacy-let.nix | 4 +- .../tests/tvix_tests/eval-okay-let-identifiers.nix | 3 +- .../src/tests/tvix_tests/eval-okay-let-inherit.nix | 15 +-- .../tvix_tests/eval-okay-let-sibling-access.nix | 3 +- .../tests/tvix_tests/eval-okay-list-comparison.nix | 2 +- .../src/tests/tvix_tests/eval-okay-listtoattrs.nix | 13 ++- .../tvix_tests/eval-okay-logical-and-catchable.nix | 2 +- .../tvix_tests/eval-okay-logical-or-catchable.nix | 2 +- .../src/tests/tvix_tests/eval-okay-manual-rec.nix | 3 +- .../eval-okay-nested-deferred-upvalue.nix | 12 +- .../tests/tvix_tests/eval-okay-nested-keys-let.nix | 3 +- .../tvix_tests/eval-okay-nested-let-slots.nix | 23 ++-- .../src/tests/tvix_tests/eval-okay-nested-let.nix | 13 ++- .../tvix_tests/eval-okay-nested-poisoning.nix | 3 +- .../tests/tvix_tests/eval-okay-nested-thunks.nix | 3 +- .../src/tests/tvix_tests/eval-okay-nested-with.nix | 3 +- .../tests/tvix_tests/eval-okay-parsedrvname.nix | 11 +- .../src/tests/tvix_tests/eval-okay-pathexists.nix | 2 +- .../eval/src/tests/tvix_tests/eval-okay-remove.nix | 6 +- .../eval-okay-repeated-list-to-attrs.nix | 7 +- .../src/tests/tvix_tests/eval-okay-simple-let.nix | 3 +- .../src/tests/tvix_tests/eval-okay-simple-with.nix | 3 +- .../eval-okay-substring-propagate-catchables.nix | 2 +- .../tests/tvix_tests/eval-okay-thunked-functor.nix | 3 +- .../src/tests/tvix_tests/eval-okay-thunked-if.nix | 10 +- .../tests/tvix_tests/eval-okay-thunked-with.nix | 3 +- .../tvix_tests/eval-okay-toplevel-finaliser.nix | 3 +- .../tests/tvix_tests/eval-okay-unpoison-scope.nix | 15 ++- .../tvix_tests/eval-okay-useless-inherit-with.nix | 7 +- .../tvix_tests/eval-okay-value-pointer-compare.nix | 2 +- .../eval-okay-value-pointer-equality.nix | 2 +- .../tvix_tests/eval-okay-with-in-dynamic-key.nix | 3 +- .../tests/tvix_tests/eval-okay-with-in-list.nix | 3 +- tvix/eval/src/tests/tvix_tests/lib.nix | 37 ++++--- ...-builtins-genericClosure-uncomparable-keys2.nix | 4 +- .../eval-okay-cycle-display-cpp-nix-2.13.nix | 6 +- .../eval-okay-minimal-2.3-builtins.nix | 121 ++++++++++++++++++--- 90 files changed, 411 insertions(+), 271 deletions(-) (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/tests/tvix_tests/eval-fail-builtins-thunk-error.nix b/tvix/eval/src/tests/tvix_tests/eval-fail-builtins-thunk-error.nix index bb0d5920d7..6df79d13f4 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-fail-builtins-thunk-error.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-fail-builtins-thunk-error.nix @@ -1 +1 @@ -builtins.genList (_: {}.foo) 1 +builtins.genList (_: { }.foo) 1 diff --git a/tvix/eval/src/tests/tvix_tests/eval-fail-closed-formals.nix b/tvix/eval/src/tests/tvix_tests/eval-fail-closed-formals.nix index 937604c563..a0cd20c470 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-fail-closed-formals.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-fail-closed-formals.nix @@ -1 +1 @@ -({x}: x) {x = 1; y = 2;} +({ x }: x) { x = 1; y = 2; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-fail-force-before-value-pointer-equality.nix b/tvix/eval/src/tests/tvix_tests/eval-fail-force-before-value-pointer-equality.nix index de6c943256..a2182a508f 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-fail-force-before-value-pointer-equality.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-fail-force-before-value-pointer-equality.nix @@ -2,4 +2,4 @@ let x = throw "I have been forced"; in -x == x \ No newline at end of file +x == x diff --git a/tvix/eval/src/tests/tvix_tests/eval-fail-remove.nix b/tvix/eval/src/tests/tvix_tests/eval-fail-remove.nix index 539e0eb0a6..93dd8ccd45 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-fail-remove.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-fail-remove.nix @@ -1,5 +1,5 @@ let { - attrs = {x = 123; y = 456;}; +attrs = { x = 123; y = 456; }; - body = (removeAttrs attrs ["x"]).x; -} \ No newline at end of file +body = (removeAttrs attrs [ "x" ]).x; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-access-strange-identifier.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-access-strange-identifier.nix index 8e282d1280..433f53dc56 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-access-strange-identifier.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-access-strange-identifier.nix @@ -2,7 +2,8 @@ let # There is no syntax for accessing this identifier in an ordinary # way. "foo bar" = 42; -in ({ +in +({ # but we *can* inherit it back out inherit "foo bar"; })."foo bar" diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-assert-thunk-condition.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-assert-thunk-condition.nix index 8934b3d8cf..ac65f5814d 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-assert-thunk-condition.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-assert-thunk-condition.nix @@ -3,5 +3,5 @@ let in # The function application here will become a thunk which verifies that -# assert forces the condition expression correctly. + # assert forces the condition expression correctly. assert condition 21 42; 21 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix index 587aec8933..9ecb4e9880 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix @@ -1,2 +1,2 @@ # the 'from' part of an `inherit` can be any expression. -{ inherit ({a = 15;}) a; }.a +{ inherit ({ a = 15; }) a; }.a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-lhs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-lhs.nix index 9596be22b8..973170cdd5 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-lhs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-lhs.nix @@ -1 +1 @@ -{} // { a = "ok"; } +{ } // { a = "ok"; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-rhs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-rhs.nix index 117c011413..f51b88e93a 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-rhs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-rhs.nix @@ -1 +1 @@ -{ a = "ok"; } // {} +{ a = "ok"; } // { } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix index f47c6f22bb..240736b12a 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix @@ -1 +1 @@ -(builtins.tryEval ( builtins.baseNameOf (throw "jill") )).success +(builtins.tryEval (builtins.baseNameOf (throw "jill"))).success diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrnames.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrnames.nix index 67f7dcee56..82240a0647 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrnames.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrnames.nix @@ -1,5 +1,5 @@ [ - (builtins.attrNames {}) + (builtins.attrNames { }) (builtins.attrNames { foo = 1; bar = 2; baz = 3; }) (builtins.attrNames { Foo = 1; bar = 2; Baz = 3; }) (builtins.attrNames { diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues.nix index 5eced31f0d..ce6c5c3816 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues.nix @@ -1,4 +1,4 @@ [ - (builtins.attrValues {}) + (builtins.attrValues { }) (builtins.attrValues { foo = 1; bar = 2; baz = 3; }) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-builtins.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-builtins.nix index cfbcbbb768..434ccf8049 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-builtins.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-builtins.nix @@ -1 +1 @@ -[ builtins ] == [ builtins.builtins ] +[ builtins ] == [ builtins.builtins ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix index cce554b449..40a90b5070 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.nix @@ -4,7 +4,7 @@ let ord1 = builtins.compareVersions a b; ord2 = builtins.compareVersions b a; in - assert ord1 == -ord2; ord1; + assert ord1 == -ord2; ord1; in [ diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists-propagate-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists-propagate-catchable.nix index 383425320c..8071daf7fb 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists-propagate-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists-propagate-catchable.nix @@ -1 +1 @@ -map (e: (builtins.tryEval e).success) [ (builtins.concatLists (builtins.throw "a")) (builtins.concatLists [ [] (builtins.throw "a") ]) (builtins.concatLists [ [] [] [ builtins.throw "a" ] ]) ] +map (e: (builtins.tryEval e).success) [ (builtins.concatLists (builtins.throw "a")) (builtins.concatLists [ [ ] (builtins.throw "a") ]) (builtins.concatLists [ [ ] [ ] [ builtins.throw "a" ] ]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-map-propagate-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-map-propagate-catchable.nix index aa3a444989..740f0d3fbc 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-map-propagate-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-concat-map-propagate-catchable.nix @@ -1 +1 @@ -map (e: (builtins.tryEval e).success) [ (builtins.concatMap (builtins.throw "a") [ "" ]) (builtins.concatMap (_: builtins.throw "x") [ "" ]) (builtins.concatMap (_: []) (builtins.throw "a")) ] +map (e: (builtins.tryEval e).success) [ (builtins.concatMap (builtins.throw "a") [ "" ]) (builtins.concatMap (_: builtins.throw "x") [ "" ]) (builtins.concatMap (_: [ ]) (builtins.throw "a")) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-foldl-propagate-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-foldl-propagate-catchable.nix index 234c95040b..c11a21ce1e 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-foldl-propagate-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-foldl-propagate-catchable.nix @@ -1,8 +1,8 @@ map (e: (builtins.tryEval e).success) [ - (builtins.foldl' (builtins.throw "a") {} [ {} {} {} ]) - (builtins.foldl' (x: y: x // y) {} (builtins.throw "b")) - (builtins.foldl' (_: _: builtins.throw "x") {} [ {} ]) - (builtins.foldl' (x: y: x // y) (builtins.throw "x") [ {} ]) - (builtins.foldl' (x: y: x // y) {} [ {} { a = builtins.throw "z"; } {} ]) - (builtins.foldl' (x: y: x // y) {} [ {} { b = 3; a = builtins.throw "u"; } {} ]) + (builtins.foldl' (builtins.throw "a") { } [{ } { } { }]) + (builtins.foldl' (x: y: x // y) { } (builtins.throw "b")) + (builtins.foldl' (_: _: builtins.throw "x") { } [{ }]) + (builtins.foldl' (x: y: x // y) (builtins.throw "x") [{ }]) + (builtins.foldl' (x: y: x // y) { } [{ } { a = builtins.throw "z"; } { }]) + (builtins.foldl' (x: y: x // y) { } [{ } { b = 3; a = builtins.throw "u"; } { }]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-pointer-equality.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-pointer-equality.nix index 5e662cdaf7..f6ca340c09 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-pointer-equality.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-pointer-equality.nix @@ -3,13 +3,13 @@ let in # key needs to be a list since it uses comparison, not equality checks: -# lists are comparable in Nix if all non-comparable items in them are equal (e.g. -# functions, attribute sets). + # lists are comparable in Nix if all non-comparable items in them are equal (e.g. + # functions, attribute sets). builtins.genericClosure { startSet = [ - { key = [ { inherit foo; } ]; val = null; } + { key = [{ inherit foo; }]; val = null; } ]; - operator = { val, ... }: if val != null then [] else [ - { key = [ { inherit foo; } ]; val = throw "no pointer equality? πŸ₯ΊπŸ‘‰πŸ‘ˆ"; } + operator = { val, ... }: if val != null then [ ] else [ + { key = [{ inherit foo; }]; val = throw "no pointer equality? πŸ₯ΊπŸ‘‰πŸ‘ˆ"; } ]; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix index d62ae628dc..eaf48045f2 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix @@ -1,4 +1,3 @@ - builtins.groupBy (v: v.x) [ (rec { y = x; x = "fred"; }) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-hasattr.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-hasattr.nix index e87e186b64..fb786b4f09 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-hasattr.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-hasattr.nix @@ -3,7 +3,7 @@ (builtins.hasAttr "bar" { foo = 1; bar = 2; baz = 3; }) (builtins.hasAttr "baz" { foo = 1; bar = 2; baz = 3; }) (builtins.hasAttr "FOO" { foo = 1; bar = 2; baz = 3; }) - (builtins.hasAttr "foo" {}) + (builtins.hasAttr "foo" { }) (builtins.hasAttr ("f" + "o" + "o") { foo = 1; }) (builtins.hasAttr ("b" + "a" + "r") { foo = 1; }) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix index ef1f638cbb..6af6915f97 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix @@ -1,5 +1,5 @@ [ - (builtins.length []) + (builtins.length [ ]) (builtins.length [ 1 ]) (builtins.length [ "one" "two" "three" ]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-list-to-attrs-propagate-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-list-to-attrs-propagate-catchable.nix index 232758980f..91b9f889bb 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-list-to-attrs-propagate-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-list-to-attrs-propagate-catchable.nix @@ -1,7 +1,7 @@ map (e: (builtins.tryEval e).success) [ - (builtins.listToAttrs [ { name = builtins.throw "a"; value = "b"; } ]) - (builtins.listToAttrs [ { name = "a"; value = builtins.throw "b"; } ]) - (builtins.listToAttrs [ { name = "a"; value = "b"; } { name = "c"; value = builtins.throw "d"; } ]) - (builtins.listToAttrs [ { name = "a"; value = "b"; } (builtins.throw "e") ]) + (builtins.listToAttrs [{ name = builtins.throw "a"; value = "b"; }]) + (builtins.listToAttrs [{ name = "a"; value = builtins.throw "b"; }]) + (builtins.listToAttrs [{ name = "a"; value = "b"; } { name = "c"; value = builtins.throw "d"; }]) + (builtins.listToAttrs [{ name = "a"; value = "b"; } (builtins.throw "e")]) (builtins.listToAttrs (builtins.throw "f")) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-partition.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-partition.nix index 0587330ff9..44022a9e0c 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-partition.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-partition.nix @@ -1,7 +1,7 @@ [ - (builtins.partition (_: true) [ 1 2 3 4 5]) - (builtins.partition (_: false) [ 1 2 3 4 5]) - (builtins.partition (x: x == 2) [ 1 2 3 4 5]) + (builtins.partition (_: true) [ 1 2 3 4 5 ]) + (builtins.partition (_: false) [ 1 2 3 4 5 ]) + (builtins.partition (x: x == 2) [ 1 2 3 4 5 ]) (builtins.partition (x: (builtins.length x) > 1) [ [ 1 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-remove-attrs-propagate-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-remove-attrs-propagate-catchable.nix index 2eb011aedf..8ca8a414aa 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-remove-attrs-propagate-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-remove-attrs-propagate-catchable.nix @@ -1,6 +1,6 @@ map (e: (builtins.tryEval e).success) [ (builtins.removeAttrs (builtins.throw "a") [ "a" ]) - (builtins.removeAttrs { a = {}; } (builtins.throw "b")) + (builtins.removeAttrs { a = { }; } (builtins.throw "b")) (builtins.removeAttrs { a = builtins.throw "b"; } [ "a" ]) (builtins.removeAttrs { "${builtins.throw "c"}" = "b"; } [ "c" ]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix index 24a5899609..eea3f87a2f 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix @@ -1,6 +1,6 @@ [ - (builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar") - (builtins.replaceStrings ["o"] ["a"] "a") - (builtins.replaceStrings ["" ""] ["1" "2"] "a") - (builtins.replaceStrings ["a" "b" "c"] ["A" "B" "C"] "abc") + (builtins.replaceStrings [ "oo" "a" ] [ "a" "i" ] "foobar") + (builtins.replaceStrings [ "o" ] [ "a" ] "a") + (builtins.replaceStrings [ "" "" ] [ "1" "2" ] "a") + (builtins.replaceStrings [ "a" "b" "c" ] [ "A" "B" "C" ] "abc") ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-thunked-function-calls.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-thunked-function-calls.nix index d96ddb3bd1..3a1c0b9821 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-thunked-function-calls.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-thunked-function-calls.nix @@ -24,7 +24,7 @@ ]; operator = { key, initial, ... }: if initial - then [ { key = key - 1; initial = false; value = throw "lol"; } ] + then [{ key = key - 1; initial = false; value = throw "lol"; }] else [ ]; })) (builtins.length (builtins.concatMap (m: [ m (builtins.throw m) ]) [ "Marusja" ])) diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-of.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-of.nix index a3cb659ecf..fa42c6008e 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-of.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-of.nix @@ -3,20 +3,20 @@ let in fix (self: - [ - (builtins.typeOf null) - (builtins.typeOf true) - (builtins.typeOf (true && false)) - (builtins.typeOf 12) - (builtins.typeOf (builtins.add 21 21)) - (builtins.typeOf 1.2) - (builtins.typeOf "foo") - (builtins.typeOf "${"foo" + "bar"}baz") - (builtins.typeOf {}) - # (builtins.typeOf { foo.bar = 32; }.foo) # TODO: re-enable when nested keys are done - (builtins.typeOf ({ name = "foo"; value = 13; } // { name = "bar"; })) - (builtins.typeOf self) - (builtins.typeOf fix) - (builtins.typeOf /nix/store) - ] +[ + (builtins.typeOf null) + (builtins.typeOf true) + (builtins.typeOf (true && false)) + (builtins.typeOf 12) + (builtins.typeOf (builtins.add 21 21)) + (builtins.typeOf 1.2) + (builtins.typeOf "foo") + (builtins.typeOf "${"foo" + "bar"}baz") + (builtins.typeOf { }) + # (builtins.typeOf { foo.bar = 32; }.foo) # TODO: re-enable when nested keys are done + (builtins.typeOf ({ name = "foo"; value = 13; } // { name = "bar"; })) + (builtins.typeOf self) + (builtins.typeOf fix) + (builtins.typeOf /nix/store) +] ) diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-predicates.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-predicates.nix index 3d688cb8bd..e67b219159 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-predicates.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-type-predicates.nix @@ -14,13 +14,13 @@ in (builtins.isFloat 1) (builtins.isFunction thunk) (builtins.isFunction (thunk thunk)) - (builtins.isFunction {}) + (builtins.isFunction { }) (builtins.isInt 1) (builtins.isInt (thunk 42)) (builtins.isInt 1.0) (builtins.isList [ (throw "oh no") (abort "it's over") ]) (builtins.isList (thunk [ 21 21 ])) - (builtins.isList (thunk {})) + (builtins.isList (thunk { })) (builtins.isNull null) (builtins.isNull (thunk null)) (builtins.isNull 42) diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-intersectattrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-intersectattrs.nix index cd4d62d05f..a06a383342 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-intersectattrs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-intersectattrs.nix @@ -1 +1 @@ -(builtins.tryEval (builtins.intersectAttrs (throw "fred") {})).success +(builtins.tryEval (builtins.intersectAttrs (throw "fred") { })).success diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-pointer-compare.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-pointer-compare.nix index 7c4333668d..639191be5d 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-pointer-compare.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-pointer-compare.nix @@ -5,10 +5,10 @@ let in [ ( - { q = g "ia"; } == { q = g ("i"+"a"); } + { q = g "ia"; } == { q = g ("i" + "a"); } ) ( - [ (g "ia") ] == [ (g ("i"+"a")) ] + [ (g "ia") ] == [ (g ("i" + "a")) ] ) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix index bda364f429..7be6660009 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix @@ -1,4 +1,5 @@ let # self-recursive function should be able to close over itself f = n: if n <= 0 then "done" else f (n - 1); -in f 10 +in +f 10 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-with-shadowing.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-with-shadowing.nix index 3054637752..2c4de65e76 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-with-shadowing.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-with-shadowing.nix @@ -8,7 +8,7 @@ let in # introduce some closure depth to force both kinds of upvalue -# resolution, and introduce a dynamically known `a` within the -# closures + # resolution, and introduce a dynamically known `a` within the + # closures let f = b: with { a = 2; }; c: a + b + c; in f 0 0 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-coerce-opadd.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-coerce-opadd.nix index 6ddd30e7a1..e79e521f8a 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-coerce-opadd.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-coerce-opadd.nix @@ -2,6 +2,6 @@ ({ __toString = _: "lord"; } + "nikon") ("zero" + { __toString = _: "cool"; }) (/tmp/31337 + "h4x0r") - ("foo" + { outPath="blah"; }) - ({ outPath="blah"; } + "foo") + ("foo" + { outPath = "blah"; }) + ({ outPath = "blah"; } + "foo") ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-compare-lists.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-compare-lists.nix index 9b73df61d8..1837f4d820 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-compare-lists.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-compare-lists.nix @@ -1,17 +1,17 @@ [ - ([1 2] < [1]) - ([1 2] < [2 3]) - ([1 2] < [2]) - ([1 2] < [1 2 3]) - ([3 4] < [1]) - ([1 2] > [1]) - ([1 2] > [2 3]) - ([1 2] > [2]) - ([1 2] > [1 2 3]) - ([3 4] > [1]) - ([1 2] <= [1]) - ([1 2] >= [2 3]) - ([1 2] >= [2]) - ([1 2] <= [1 2 3]) - ([3 4] >= [1]) + ([ 1 2 ] < [ 1 ]) + ([ 1 2 ] < [ 2 3 ]) + ([ 1 2 ] < [ 2 ]) + ([ 1 2 ] < [ 1 2 3 ]) + ([ 3 4 ] < [ 1 ]) + ([ 1 2 ] > [ 1 ]) + ([ 1 2 ] > [ 2 3 ]) + ([ 1 2 ] > [ 2 ]) + ([ 1 2 ] > [ 1 2 3 ]) + ([ 3 4 ] > [ 1 ]) + ([ 1 2 ] <= [ 1 ]) + ([ 1 2 ] >= [ 2 3 ]) + ([ 1 2 ] >= [ 2 ]) + ([ 1 2 ] <= [ 1 2 3 ]) + ([ 3 4 ] >= [ 1 ]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-concatmap.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-concatmap.nix index 149a0722b1..cff39b05e6 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-concatmap.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-concatmap.nix @@ -1 +1 @@ -(builtins.concatMap (x: [x] ++ ["z"]) ["a" "b"]) +(builtins.concatMap (x: [ x ] ++ [ "z" ]) [ "a" "b" ]) diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-concatstringssep.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-concatstringssep.nix index adc4c41bd5..cd94ca99b4 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-concatstringssep.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-concatstringssep.nix @@ -1,8 +1,9 @@ with builtins; -[ (concatStringsSep "" []) - (concatStringsSep "" ["foo" "bar" "xyzzy"]) - (concatStringsSep ", " ["foo" "bar" "xyzzy"]) - (concatStringsSep ", " ["foo"]) - (concatStringsSep ", " []) +[ + (concatStringsSep "" [ ]) + (concatStringsSep "" [ "foo" "bar" "xyzzy" ]) + (concatStringsSep ", " [ "foo" "bar" "xyzzy" ]) + (concatStringsSep ", " [ "foo" ]) + (concatStringsSep ", " [ ]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-with-closure.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-with-closure.nix index 7f13f1f270..f65e8ee537 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-with-closure.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-deeply-nested-with-closure.nix @@ -15,4 +15,7 @@ with { c = 3; d = 3; }; _: with { d = 4; }; -[ a b c d ]) null null null null +[ a b c d ]) null + null + null + null diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-deferred-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-deferred-with.nix index af227ae28e..ccafdf74ce 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-deferred-with.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-deferred-with.nix @@ -5,4 +5,5 @@ let set = { value = 42; }; -in result +in +result diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-eq-nested-list.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-eq-nested-list.nix index 5dbcb51529..cc39e2415f 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-eq-nested-list.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-eq-nested-list.nix @@ -1 +1 @@ -[["f" ""]] == [["f" ""]] +[ [ "f" "" ] ] == [ [ "f" "" ] ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-equality-tolerate-catchable-in-type-field.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-equality-tolerate-catchable-in-type-field.nix index ecfc2ad375..6bd018b68d 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-equality-tolerate-catchable-in-type-field.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-equality-tolerate-catchable-in-type-field.nix @@ -1 +1 @@ -(builtins.tryEval (builtins.elem { type = rec { x = throw "fred"; }.x; } [ { type = 3; } ])).success +(builtins.tryEval (builtins.elem { type = rec { x = throw "fred"; }.x; } [{ type = 3; }])).success diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-fib.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-fib.nix index 9a22d85ac5..04cb52e033 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-fib.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-fib.nix @@ -1,7 +1,9 @@ let - fib' = i: n: m: if i == 0 + fib' = i: n: m: + if i == 0 then n else fib' (i - 1) m (n + m); fib = n: fib' n 1 1; -in fib 10 +in +fib 10 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix index 27d2fae104..6069950194 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix @@ -1,6 +1,7 @@ let fix = f: let x = f x; in x; -in fix(self: { +in +fix (self: { a = 1; b = self.a + 20; c = self.b * 2; diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-foldlStrict.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-foldlStrict.nix index 44c0349387..aadf5e1121 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-foldlStrict.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-foldlStrict.nix @@ -1,5 +1,5 @@ [ - (builtins.foldl' builtins.add 0 [1 2 3]) - (builtins.foldl' (l1: l2: l1 ++ l2) [0] [[1] [2 3]]) - (builtins.foldl' (x: y: if x == 0 then y else x * y) 0 [1 2]) + (builtins.foldl' builtins.add 0 [ 1 2 3 ]) + (builtins.foldl' (l1: l2: l1 ++ l2) [ 0 ] [ [ 1 ] [ 2 3 ] ]) + (builtins.foldl' (x: y: if x == 0 then y else x * y) 0 [ 1 2 ]) ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-formals-miscompilation-b-261-regression.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-formals-miscompilation-b-261-regression.nix index 43bef2938d..772fa6f386 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-formals-miscompilation-b-261-regression.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-formals-miscompilation-b-261-regression.nix @@ -14,7 +14,7 @@ let in # Note that the crash did not occur if the offending expression was the rhs -# argument to `builtins.seq`, hence we need to put the assert in between. + # argument to `builtins.seq`, hence we need to put the assert in between. assert builtins.seq bomb true; f { finalise = bomb; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.nix index e530789446..1083919af8 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.nix @@ -1,24 +1,24 @@ [ -# RFC 7159, section 13. + # 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.396 + { + "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.396 + } } - } - '') + '') (builtins.fromJSON ''{"name": "a", "value": "b"}'') (builtins.fromJSON "[ 1, 2, 3, 4 ]") ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-functionargs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-functionargs.nix index cd95b971f8..6db04c562c 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-functionargs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-functionargs.nix @@ -1,21 +1,22 @@ let - stdenvFun = { }: { name = "stdenv"; }; - stdenv2Fun = { }: { name = "stdenv2"; }; + 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}"; }; + { 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: + { + override = newArgs: makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs)); }; @@ -37,7 +38,8 @@ let mplayer = callPackage mplayerFun { stdenv = pkgs.stdenv2; enableFoo = false; }; nix = callPackage nixFun { }; }; - in pkgs; + in + pkgs; libX11Fun = { stdenv, fetchurl }: { name = "libX11"; }; libX11_2Fun = { stdenv, fetchurl }: { name = "libX11_2"; }; @@ -67,14 +69,15 @@ let 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 - ] +[ + 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/tvix_tests/eval-okay-inherit-string-ident.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-inherit-string-ident.nix index dde81e5a7c..75794d3337 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-inherit-string-ident.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-inherit-string-ident.nix @@ -4,4 +4,5 @@ let set = { inherit ({ value = 42; }) "value"; }; -in set.value +in +set.value diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-intersectattrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-intersectattrs.nix index 3534132ed4..f02d963226 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-intersectattrs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-intersectattrs.nix @@ -1,3 +1,3 @@ builtins.intersectAttrs - { a = 1; b = 2; c = 3; } - { a = 100; b = 200; d = 5; } +{ a = 1; b = 2; c = 3; } +{ a = 100; b = 200; d = 5; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding-closure.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding-closure.nix index dae170b06b..4312ec9a52 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding-closure.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding-closure.nix @@ -1,4 +1,5 @@ let f = n: n + a; a = 2; -in f 40 +in +f 40 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding.nix index 41c4c53ea2..6b6875cf1a 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-late-binding.nix @@ -1,4 +1,5 @@ let a = b; b = 42; -in a +in +a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix index d19d1213d6..92363245f8 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix @@ -6,7 +6,8 @@ let list3 = [ (2 + 2) ]; list4 = [ (2 + 2) ]; list5 = [ (2 + 2) ]; -in [ +in +[ (attrs1 == attrs2) (list1 == list2) (list3 == list2) diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix index 87fcffadee..a411b1c4a4 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix @@ -1,9 +1,9 @@ let { - a = 21; - b = body.one; +a = 21; +b = body.one; - body = { - one = a * 2; - two = b; - }; +body = { + one = a * 2; + two = b; +}; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-in-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-in-with.nix index a5b0542668..7d95efa5c3 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-in-with.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-in-with.nix @@ -1 +1 @@ -with {}; let { body = 42; } +with { }; let { body = 42; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix index 850e0252c2..faabe25457 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix @@ -1,4 +1,4 @@ let { - a = 21; - body = a * 2; +a = 21; +body = a * 2; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix index b6c37c34f9..ce588be069 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix @@ -2,4 +2,5 @@ let a = 1; "b" = 2; ${"c"} = 3; -in [ a b c ] +in +[ a b c ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix index 4ec270e3bf..3aa7c0f8d2 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix @@ -3,10 +3,11 @@ let a = 1; }; in - let - set2 = { - b = 1; - }; - inherit (set) a; - inherit (set2) b; - in a + b +let + set2 = { + b = 1; + }; + inherit (set) a; + inherit (set2) b; +in +a + b diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix index 7a65a5b1cc..faad81a213 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix @@ -2,4 +2,5 @@ let a = 1; b = 2; c = a + b; -in c +in +c diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-list-comparison.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-list-comparison.nix index 79cc27be65..7796fe4cbb 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-list-comparison.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-list-comparison.nix @@ -1 +1 @@ -[ 1 2 ] > [ ((rec{x=1;}).x) 2] +[ 1 2 ] > [ ((rec{ x = 1; }).x) 2 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-listtoattrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-listtoattrs.nix index 89888fd561..551db72cb0 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-listtoattrs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-listtoattrs.nix @@ -1,15 +1,16 @@ with builtins; let fold = op: nul: list: - if list == [] + if list == [ ] then nul else op (head list) (fold op nul (tail list)); concat = fold (x: y: x + y) ""; - asi = name: value : { inherit name value; }; - list = [ ( asi "a" "A" ) ( asi "b" "B" ) ]; + asi = name: value: { inherit name value; }; + list = [ (asi "a" "A") (asi "b" "B") ]; a = builtins.listToAttrs list; - b = builtins.listToAttrs ( list ++ list ); - r = builtins.listToAttrs [ (asi "result" [ a b ]) ( asi "throw" (throw "this should not be thrown")) ]; + b = builtins.listToAttrs (list ++ list); + r = builtins.listToAttrs [ (asi "result" [ a b ]) (asi "throw" (throw "this should not be thrown")) ]; x = builtins.listToAttrs [ (asi "foo" "bar") (asi "foo" "bla") ]; -in concat (map (x: x.a) r.result) + x.foo +in +concat (map (x: x.a) r.result) + x.foo diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-logical-and-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-logical-and-catchable.nix index f731f09241..dd2a9baa75 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-logical-and-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-logical-and-catchable.nix @@ -1 +1 @@ -(builtins.tryEval ( (throw "fred") && (throw "jill") )).success +(builtins.tryEval ((throw "fred") && (throw "jill"))).success diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-logical-or-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-logical-or-catchable.nix index 64168499c6..3adccfa441 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-logical-or-catchable.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-logical-or-catchable.nix @@ -1 +1 @@ -(builtins.tryEval ( (throw "fred") || (throw "jill") )).success +(builtins.tryEval ((throw "fred") || (throw "jill"))).success diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.nix index 8e1256d764..23459e384a 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.nix @@ -6,4 +6,5 @@ let a = 21; b = a * 2; }; -in set.b +in +set.b diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix index 358925e992..3fa1d3ed05 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix @@ -1,6 +1,10 @@ let doubler = n: outer n; - outer = let inner = n: a * n; - a = 2; - in inner; -in doubler 10 + outer = + let + inner = n: a * n; + a = 2; + in + inner; +in +doubler 10 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-keys-let.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-keys-let.nix index c75b7130e1..c99ac748e6 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-keys-let.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-keys-let.nix @@ -1,4 +1,5 @@ let inner = 21; set.a.b = inner * 2; -in set +in +set diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix index 811bb4361b..eec5940875 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix @@ -6,12 +6,17 @@ let a = 1; b = 2; - outer = let - c = 3; - d = 4; - inner = let - e = 5; - f = 6; - in g: [ a b c d e f g ]; - in inner; -in outer 7 + outer = + let + c = 3; + d = 4; + inner = + let + e = 5; + f = 6; + in + g: [ a b c d e f g ]; + in + inner; +in +outer 7 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let.nix index caaa202119..f40c04b139 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let.nix @@ -1,7 +1,10 @@ let - a = let - b = 1; - c = 2; - in b + c; + a = + let + b = 1; + c = 2; + in + b + c; b = 4; -in a + b +in +a + b diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-poisoning.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-poisoning.nix index 8d0280bb89..0fd22a671c 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-poisoning.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-poisoning.nix @@ -1,4 +1,5 @@ let null = 1; f = n: n + null; -in f 41 +in +f 41 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-thunks.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-thunks.nix index 133929dd19..2519221e97 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-thunks.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-thunks.nix @@ -4,4 +4,5 @@ let a = b; b = c; c = 42; -in a +in +a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix index ea5ef568ed..fa832b2099 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix @@ -1,4 +1,5 @@ let set1 = { a = 1; }; set2 = { a = 2; }; -in with set1; with set2; a +in +with set1; with set2; a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix index fea6e234dc..5997c99b47 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix @@ -1,12 +1,11 @@ - # the first dash followed by a non-alphabetic character separates # the "name" from the "version" -assert builtins.parseDrvName "ripgrep-1.2" == { name = "ripgrep"; version = "1.2"; }; -assert builtins.parseDrvName "rip-grep-1.2" == { name = "rip-grep"; version = "1.2"; }; +assert builtins.parseDrvName "ripgrep-1.2" == { name = "ripgrep"; version = "1.2"; }; +assert builtins.parseDrvName "rip-grep-1.2" == { name = "rip-grep"; version = "1.2"; }; assert builtins.parseDrvName "7zip_archiver-0.2" == { name = "7zip_archiver"; version = "0.2"; }; -assert builtins.parseDrvName "gcc-1-2" == { name = "gcc"; version = "1-2"; }; -assert builtins.parseDrvName "bash--1-2" == { name = "bash"; version = "-1-2"; }; -assert builtins.parseDrvName "xvidtune-?1-2" == { name = "xvidtune"; version = "?1-2"; }; +assert builtins.parseDrvName "gcc-1-2" == { name = "gcc"; version = "1-2"; }; +assert builtins.parseDrvName "bash--1-2" == { name = "bash"; version = "-1-2"; }; +assert builtins.parseDrvName "xvidtune-?1-2" == { name = "xvidtune"; version = "?1-2"; }; true diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-pathexists.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-pathexists.nix index ab3d036940..c9eedb44ff 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-pathexists.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-pathexists.nix @@ -1,2 +1,2 @@ builtins.pathExists ./lib.nix -&& !builtins.pathExists ./bla.nix + && !builtins.pathExists ./bla.nix diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-remove.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-remove.nix index 4ad5ba897f..62c5aa1fd4 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-remove.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-remove.nix @@ -1,5 +1,5 @@ let { - attrs = {x = 123; y = 456;}; +attrs = { x = 123; y = 456; }; - body = (removeAttrs attrs ["x"]).y; -} \ No newline at end of file +body = (removeAttrs attrs [ "x" ]).y; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-repeated-list-to-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-repeated-list-to-attrs.nix index 2f719dcef5..ed819d76c7 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-repeated-list-to-attrs.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-repeated-list-to-attrs.nix @@ -3,11 +3,12 @@ let inherit (builtins) foldl' listToAttrs; - input = [ { name = "result"; value = 1; } { name = "result"; value = 2; } ]; + input = [{ name = "result"; value = 1; } { name = "result"; value = 2; }]; # foldl-based version of listToAttrs with the _opposite_ behaviour. - listToAttrs' = list: foldl' ( acc: elem: acc // { ${elem.name} = elem.value; }) {} list; -in [ + listToAttrs' = list: foldl' (acc: elem: acc // { ${elem.name} = elem.value; }) { } list; +in +[ (listToAttrs input).result (listToAttrs' input).result ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix index b440a220ff..b4da0f824a 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix @@ -1,4 +1,5 @@ let a = 1; b = 2; -in a + b +in +a + b diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix index 64962b50ff..3d375be4f9 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix @@ -2,4 +2,5 @@ let set = { a = 1; }; -in with set; a +in +with set; a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-substring-propagate-catchables.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-substring-propagate-catchables.nix index c5a6f5a820..78d5dda38e 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-substring-propagate-catchables.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-substring-propagate-catchables.nix @@ -1 +1 @@ -(builtins.tryEval ( builtins.substring 0 4 (throw "jill") )).success +(builtins.tryEval (builtins.substring 0 4 (throw "jill"))).success diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-functor.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-functor.nix index f8eba2ac2f..568a5c5413 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-functor.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-functor.nix @@ -1,7 +1,8 @@ let __functor = f; f = self: x: self.out * x; -in { +in +{ inherit __functor; out = 21; } 2 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-if.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-if.nix index 65e9e66d74..3810ebe784 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-if.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-if.nix @@ -1,6 +1,8 @@ let - a = {}; -in let + a = { }; +in +let c = if builtins.isFunction a then a b else a; - b = {}; -in c + b = { }; +in +c diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-with.nix index 6f32660c4c..799408b2e6 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-with.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-thunked-with.nix @@ -4,4 +4,5 @@ let set = { a = with { b = 42; }; b; }; -in set.a +in +set.a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-toplevel-finaliser.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-toplevel-finaliser.nix index 4c6884bec3..5f25f80671 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-toplevel-finaliser.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-toplevel-finaliser.nix @@ -5,6 +5,7 @@ let a = 1; b = 2; c = 3; -in { +in +{ inherit a b c; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-unpoison-scope.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-unpoison-scope.nix index 30e9667da8..539735a8ef 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-unpoison-scope.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-unpoison-scope.nix @@ -1,7 +1,10 @@ let - poisoned = let - true = 1; - false = 2; - null = 3; - in [ true false null ]; -in [ true false null ] ++ poisoned + poisoned = + let + true = 1; + false = 2; + null = 3; + in + [ true false null ]; +in +[ true false null ] ++ poisoned diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-useless-inherit-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-useless-inherit-with.nix index d335e53630..dd768c1aca 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-useless-inherit-with.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-useless-inherit-with.nix @@ -3,13 +3,14 @@ # provide the value. # Provide a dynamic `x` identifier in the scope. -with ({ x = 1;}); +with ({ x = 1; }); # inherit this `x` as a static identifier let inherit x; -# Provide another dynamic `x` identifier -in with ({ x = 3; }); + # Provide another dynamic `x` identifier +in +with ({ x = 3; }); # Inherited static identifier should have precedence x diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix index f60d27d381..c2ca913af2 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix @@ -3,4 +3,4 @@ let f = owo: "thia"; in -[ f 42 ] > [ f 21 ] \ No newline at end of file +[ f 42 ] > [ f 21 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-equality.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-equality.nix index 206881d7d9..b5cfbeb12e 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-equality.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-value-pointer-equality.nix @@ -43,4 +43,4 @@ in # pointer inequality (peq1 f (x: x)) (peq2 (x: x) f) -] \ No newline at end of file +] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-dynamic-key.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-dynamic-key.nix index c44455a5bf..bf221746c0 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-dynamic-key.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-dynamic-key.nix @@ -9,4 +9,5 @@ let ${with set1; key} = 20; ${with { key = "c"; }; key} = 2; }; -in set2.a + set2.b + set2.c +in +set2.a + set2.b + set2.c diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix index bb62fdf31c..3e85cbee45 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix @@ -6,7 +6,8 @@ let set = { value = 2; }; -in [ +in +[ 1 (with set; value) 3 diff --git a/tvix/eval/src/tests/tvix_tests/lib.nix b/tvix/eval/src/tests/tvix_tests/lib.nix index 028a538314..ab509bc85f 100644 --- a/tvix/eval/src/tests/tvix_tests/lib.nix +++ b/tvix/eval/src/tests/tvix_tests/lib.nix @@ -3,7 +3,7 @@ with builtins; rec { fold = op: nul: list: - if list == [] + if list == [ ] then nul else op (head list) (fold op nul (tail list)); @@ -14,23 +14,25 @@ rec { flatten = x: if isList x - then fold (x: y: (flatten x) ++ y) [] x - else [x]; + then fold (x: y: (flatten x) ++ y) [ ] x + else [ x ]; sum = foldl' (x: y: add x y) 0; hasSuffix = ext: fileName: - let lenFileName = stringLength fileName; - lenExt = stringLength ext; - in !(lessThan lenFileName lenExt) && - substring (sub lenFileName lenExt) lenFileName fileName == ext; + let + lenFileName = stringLength fileName; + lenExt = stringLength ext; + in + !(lessThan lenFileName lenExt) && + substring (sub lenFileName lenExt) lenFileName fileName == ext; # Split a list at the given position. splitAt = pos: list: - if pos == 0 then {first = []; second = list;} else - if list == [] then {first = []; second = [];} else + if pos == 0 then { first = [ ]; second = list; } else + if list == [ ] then { first = [ ]; second = [ ]; } else let res = splitAt (sub pos 1) (tail list); - in {first = [(head list)] ++ res.first; second = res.second;}; + in { first = [ (head list) ] ++ res.first; second = res.second; }; # Stable merge sort. sortBy = comp: list: @@ -40,14 +42,15 @@ rec { split = splitAt (div (length list) 2) list; first = sortBy comp split.first; second = sortBy comp split.second; - in mergeLists comp first second + in + mergeLists comp first second else list; mergeLists = comp: list1: list2: - if list1 == [] then list2 else - if list2 == [] then list1 else - if comp (head list2) (head list1) then [(head list2)] ++ mergeLists comp list1 (tail list2) else - [(head list1)] ++ mergeLists comp (tail list1) list2; + if list1 == [ ] then list2 else + if list2 == [ ] then list1 else + if comp (head list2) (head list1) then [ (head list2) ] ++ mergeLists comp list1 (tail list2) else + [ (head list1) ] ++ mergeLists comp (tail list1) list2; id = x: x; @@ -55,7 +58,7 @@ rec { range = first: last: if first > last - then [] - else genList (n: first + n) (last - first + 1); + then [ ] + else genList (n: first + n) (last - first + 1); } diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-fail-builtins-genericClosure-uncomparable-keys2.nix b/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-fail-builtins-genericClosure-uncomparable-keys2.nix index ca28255245..0589a3ab59 100644 --- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-fail-builtins-genericClosure-uncomparable-keys2.nix +++ b/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-fail-builtins-genericClosure-uncomparable-keys2.nix @@ -3,10 +3,10 @@ let in builtins.genericClosure { - startSet = [ { key = id; first = true; } ]; + startSet = [{ key = id; first = true; }]; operator = { first, ... }: if first then [ { key = id; first = false; } - ] else []; + ] else [ ]; } diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-cycle-display-cpp-nix-2.13.nix b/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-cycle-display-cpp-nix-2.13.nix index bd3b1429ce..ac849a58fe 100644 --- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-cycle-display-cpp-nix-2.13.nix +++ b/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-cycle-display-cpp-nix-2.13.nix @@ -17,9 +17,9 @@ let }; multiTail = { - val = 42; - tail1 = multiTail; - tail2 = multiTail; + val = 42; + tail1 = multiTail; + tail2 = multiTail; }; in diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-minimal-2.3-builtins.nix b/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-minimal-2.3-builtins.nix index 804355f34d..4480daecd9 100644 --- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-minimal-2.3-builtins.nix +++ b/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-minimal-2.3-builtins.nix @@ -10,23 +10,110 @@ let # C++ Nix 2.3 builtins except valueSize which is removed in later versions minimalBuiltins = [ - "abort" "add" "addErrorContext" "all" "any" "appendContext" "attrNames" - "attrValues" "baseNameOf" "bitAnd" "bitOr" "bitXor" "builtins" "catAttrs" - "compareVersions" "concatLists" "concatMap" "concatStringsSep" - "currentSystem" "currentTime" "deepSeq" "derivation" "derivationStrict" - "dirOf" "div" "elem" "elemAt" "false" "fetchGit" "fetchMercurial" - "fetchTarball" "fetchurl" "filter" "filterSource" "findFile" "foldl'" - "fromJSON" "fromTOML" "functionArgs" "genList" "genericClosure" "getAttr" - "getContext" "getEnv" "hasAttr" "hasContext" "hashFile" "hashString" "head" - "import" "intersectAttrs" "isAttrs" "isBool" "isFloat" "isFunction" "isInt" - "isList" "isNull" "isPath" "isString" "langVersion" "length" "lessThan" - "listToAttrs" "map" "mapAttrs" "match" "mul" "nixPath" "nixVersion" "null" - "parseDrvName" "partition" "path" "pathExists" "placeholder" "readDir" - "readFile" "removeAttrs" "replaceStrings" "scopedImport" "seq" "sort" - "split" "splitVersion" "storeDir" "storePath" "stringLength" "sub" - "substring" "tail" "throw" "toFile" "toJSON" "toPath" "toString" "toXML" - "trace" "true" "tryEval" "typeOf" "unsafeDiscardOutputDependency" - "unsafeDiscardStringContext" "unsafeGetAttrPos" + "abort" + "add" + "addErrorContext" + "all" + "any" + "appendContext" + "attrNames" + "attrValues" + "baseNameOf" + "bitAnd" + "bitOr" + "bitXor" + "builtins" + "catAttrs" + "compareVersions" + "concatLists" + "concatMap" + "concatStringsSep" + "currentSystem" + "currentTime" + "deepSeq" + "derivation" + "derivationStrict" + "dirOf" + "div" + "elem" + "elemAt" + "false" + "fetchGit" + "fetchMercurial" + "fetchTarball" + "fetchurl" + "filter" + "filterSource" + "findFile" + "foldl'" + "fromJSON" + "fromTOML" + "functionArgs" + "genList" + "genericClosure" + "getAttr" + "getContext" + "getEnv" + "hasAttr" + "hasContext" + "hashFile" + "hashString" + "head" + "import" + "intersectAttrs" + "isAttrs" + "isBool" + "isFloat" + "isFunction" + "isInt" + "isList" + "isNull" + "isPath" + "isString" + "langVersion" + "length" + "lessThan" + "listToAttrs" + "map" + "mapAttrs" + "match" + "mul" + "nixPath" + "nixVersion" + "null" + "parseDrvName" + "partition" + "path" + "pathExists" + "placeholder" + "readDir" + "readFile" + "removeAttrs" + "replaceStrings" + "scopedImport" + "seq" + "sort" + "split" + "splitVersion" + "storeDir" + "storePath" + "stringLength" + "sub" + "substring" + "tail" + "throw" + "toFile" + "toJSON" + "toPath" + "toString" + "toXML" + "trace" + "true" + "tryEval" + "typeOf" + "unsafeDiscardOutputDependency" + "unsafeDiscardStringContext" + "unsafeGetAttrPos" ]; intersectLists = as: bs: builtins.filter (a: builtins.elem a bs) as; -- cgit 1.4.1