diff options
Diffstat (limited to 'tvix/eval/src/tests/nix_tests')
85 files changed, 496 insertions, 61 deletions
diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-foldlStrict-strict-op-application.nix b/tvix/eval/src/tests/nix_tests/eval-fail-foldlStrict-strict-op-application.nix new file mode 100644 index 0000000000..1620cc76ee --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-fail-foldlStrict-strict-op-application.nix @@ -0,0 +1,5 @@ +# Tests that the result of applying op is forced even if the value is never used +builtins.foldl' + (_: f: f null) + null + [ (_: throw "Not the final value, but is still forced!") (_: 23) ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-closure.exp b/tvix/eval/src/tests/nix_tests/eval-okay-closure.exp new file mode 100644 index 0000000000..e7dbf97816 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-closure.exp @@ -0,0 +1 @@ +[ { foo = true; key = -13; } { foo = true; key = -12; } { foo = true; key = -11; } { foo = true; key = -9; } { foo = true; key = -8; } { foo = true; key = -7; } { foo = true; key = -5; } { foo = true; key = -4; } { foo = true; key = -3; } { key = -1; } { foo = true; key = 0; } { foo = true; key = 1; } { foo = true; key = 2; } { foo = true; key = 4; } { foo = true; key = 5; } { foo = true; key = 6; } { key = 8; } { foo = true; key = 9; } { foo = true; key = 10; } { foo = true; key = 13; } { foo = true; key = 14; } { foo = true; key = 15; } { key = 17; } { foo = true; key = 18; } { foo = true; key = 19; } { foo = true; key = 22; } { foo = true; key = 23; } { key = 26; } { foo = true; key = 27; } { foo = true; key = 28; } { foo = true; key = 31; } { foo = true; key = 32; } { key = 35; } { foo = true; key = 36; } { foo = true; key = 40; } { foo = true; key = 41; } { key = 44; } { foo = true; key = 45; } { foo = true; key = 49; } { key = 53; } { foo = true; key = 54; } { foo = true; key = 58; } { key = 62; } { foo = true; key = 67; } { key = 71; } { key = 80; } ] 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 43178bd2ee..0000000000 --- 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-introspection.exp b/tvix/eval/src/tests/nix_tests/eval-okay-eq.exp index 27ba77ddaf..27ba77ddaf 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context-introspection.exp +++ b/tvix/eval/src/tests/nix_tests/eval-okay-eq.exp 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 2015847b65..0000000000 --- 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-foldlStrict-lazy-elements.exp b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.exp new file mode 100644 index 0000000000..d81cc0710e --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.exp @@ -0,0 +1 @@ +42 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix new file mode 100644 index 0000000000..c666e07f3a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix @@ -0,0 +1,9 @@ +# Tests that the rhs argument of op is not forced unconditionally +let + lst = builtins.foldl' + (acc: x: acc ++ [ x ]) + [ ] + [ 42 (throw "this shouldn't be evaluated") ]; +in + +builtins.head lst diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.exp b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.exp new file mode 100644 index 0000000000..d81cc0710e --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.exp @@ -0,0 +1 @@ +42 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.nix b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.nix new file mode 100644 index 0000000000..abcd5366ab --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.nix @@ -0,0 +1,6 @@ +# Checks that the nul value for the accumulator is not forced unconditionally. +# Some languages provide a foldl' that is strict in this argument, but Nix does not. +builtins.foldl' + (_: x: x) + (throw "This is never forced") + [ "but the results of applying op are" 42 ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict.exp b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict.exp new file mode 100644 index 0000000000..837e12b406 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict.exp @@ -0,0 +1 @@ +500500 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict.nix b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict.nix new file mode 100644 index 0000000000..3b87188d24 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict.nix @@ -0,0 +1,3 @@ +with import ./lib.nix; + +builtins.foldl' (x: y: x + y) 0 (range 1 1000) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix b/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix index 102ee82b5e..e1c0f86cc4 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix +++ b/tvix/eval/src/tests/nix_tests/eval-okay-fromjson.nix @@ -1,36 +1,35 @@ -# 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 + "Video": { + "Title": "The Penguin Chronicles", + "Width": 1920, + "Height": 1080, + "EmbeddedData": [3.14159, 23493,null, true ,false, -10], + "Thumb": { + "Url": "http://www.example.com/video/5678931", + "Width": 200, + "Height": 250 }, - "Animated" : false, - "IDs": [116, 943, 234, 38793, true ,false,null, -100], - "Latitude": 37.7668, - "Longitude": -122.3959 + "Subtitle" : false, + "Latitude": 46.2051, + "Longitude": 6.0723 } } '' == - { Image = - { Width = 800; - Height = 600; - Title = "View from 15th Floor"; - Thumbnail = - { Url = http://www.example.com/image/481989943; - Height = 125; - Width = 100; + { Video = + { Title = "The Penguin Chronicles"; + Width = 1920; + Height = 1080; + EmbeddedData = [ 3.14159 23493 null true false (0-10) ]; + Thumb = + { Url = "http://www.example.com/video/5678931"; + Width = 200; + Height = 250; }; - Animated = false; - IDs = [ 116 943 234 38793 true false null (0-100) ]; - Latitude = 37.7668; - Longitude = -122.3959; + Subtitle = false; + Latitude = 46.2051; + Longitude = 6.0723; }; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp b/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp new file mode 100644 index 0000000000..c1c9f8ffaf --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-functionargs.exp @@ -0,0 +1 @@ +[ "stdenv" "fetchurl" "aterm-stdenv" "aterm-stdenv2" "libX11" "libXv" "mplayer-stdenv2.libXv-libX11" "mplayer-stdenv2.libXv-libX11_2" "nix-stdenv-aterm-stdenv" "nix-stdenv2-aterm2-stdenv2" ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-groupBy.exp b/tvix/eval/src/tests/nix_tests/eval-okay-groupBy.exp new file mode 100644 index 0000000000..bfca5652a5 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-groupBy.exp @@ -0,0 +1 @@ +{ "1" = [ 9 ]; "2" = [ 8 ]; "3" = [ 13 29 ]; "4" = [ 3 4 10 11 17 18 ]; "5" = [ 0 23 26 28 ]; "6" = [ 1 12 21 27 30 ]; "7" = [ 7 22 ]; "8" = [ 14 ]; "9" = [ 19 ]; b = [ 16 25 ]; c = [ 24 ]; d = [ 2 ]; e = [ 5 6 15 31 ]; f = [ 20 ]; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-groupBy.nix b/tvix/eval/src/tests/nix_tests/eval-okay-groupBy.nix new file mode 100644 index 0000000000..862d89dbd6 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-groupBy.nix @@ -0,0 +1,5 @@ +with import ./lib.nix; + +builtins.groupBy (n: + builtins.substring 0 1 (builtins.hashString "sha256" (toString n)) +) (range 0 31) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-ind-string.nix b/tvix/eval/src/tests/nix_tests/eval-okay-ind-string.nix index 1669dc0648..95d59b5083 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-ind-string.nix +++ b/tvix/eval/src/tests/nix_tests/eval-okay-ind-string.nix @@ -110,7 +110,7 @@ let And finally to interpret \n etc. as in a string: ''\n, ''\r, ''\t. ''; - # Regression test: antiquotation in '${x}' should work, but didn't. + # Regression test: string interpolation in '${x}' should work, but didn't. s15 = let x = "bla"; in '' foo '${x}' diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-intersectAttrs.exp b/tvix/eval/src/tests/nix_tests/eval-okay-intersectAttrs.exp new file mode 100644 index 0000000000..50445bc0ee --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-intersectAttrs.exp @@ -0,0 +1 @@ +[ { } { a = 1; } { a = 1; } { a = "a"; } { m = 1; } { m = "m"; } { n = 1; } { n = "n"; } { n = 1; p = 2; } { n = "n"; p = "p"; } { n = 1; p = 2; } { n = "n"; p = "p"; } { a = "a"; b = "b"; c = "c"; d = "d"; e = "e"; f = "f"; g = "g"; h = "h"; i = "i"; j = "j"; k = "k"; l = "l"; m = "m"; n = "n"; o = "o"; p = "p"; q = "q"; r = "r"; s = "s"; t = "t"; u = "u"; v = "v"; w = "w"; x = "x"; y = "y"; z = "z"; } true ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-intersectAttrs.nix b/tvix/eval/src/tests/nix_tests/eval-okay-intersectAttrs.nix new file mode 100644 index 0000000000..39d49938cc --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-intersectAttrs.nix @@ -0,0 +1,50 @@ +let + alphabet = + { a = "a"; + b = "b"; + c = "c"; + d = "d"; + e = "e"; + f = "f"; + g = "g"; + h = "h"; + i = "i"; + j = "j"; + k = "k"; + l = "l"; + m = "m"; + n = "n"; + o = "o"; + p = "p"; + q = "q"; + r = "r"; + s = "s"; + t = "t"; + u = "u"; + v = "v"; + w = "w"; + x = "x"; + y = "y"; + z = "z"; + }; + foo = { + inherit (alphabet) f o b a r z q u x; + aa = throw "aa"; + }; + alphabetFail = builtins.mapAttrs throw alphabet; +in +[ (builtins.intersectAttrs { a = abort "l1"; } { b = abort "r1"; }) + (builtins.intersectAttrs { a = abort "l2"; } { a = 1; }) + (builtins.intersectAttrs alphabetFail { a = 1; }) + (builtins.intersectAttrs { a = abort "laa"; } alphabet) + (builtins.intersectAttrs alphabetFail { m = 1; }) + (builtins.intersectAttrs { m = abort "lam"; } alphabet) + (builtins.intersectAttrs alphabetFail { n = 1; }) + (builtins.intersectAttrs { n = abort "lan"; } alphabet) + (builtins.intersectAttrs alphabetFail { n = 1; p = 2; }) + (builtins.intersectAttrs { n = abort "lan2"; p = abort "lap"; } alphabet) + (builtins.intersectAttrs alphabetFail { n = 1; p = 2; }) + (builtins.intersectAttrs { n = abort "lan2"; p = abort "lap"; } alphabet) + (builtins.intersectAttrs alphabetFail alphabet) + (builtins.intersectAttrs alphabet foo == builtins.intersectAttrs foo alphabet) +] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-path.exp b/tvix/eval/src/tests/nix_tests/eval-okay-path.exp new file mode 100644 index 0000000000..3ce7f82830 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-path.exp @@ -0,0 +1 @@ +"/nix/store/ya937r4ydw0l6kayq8jkyqaips9c75jm-output" diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-readDir.exp b/tvix/eval/src/tests/nix_tests/eval-okay-readDir.exp deleted file mode 100644 index bf8d2c14ea..0000000000 --- a/tvix/eval/src/tests/nix_tests/eval-okay-readDir.exp +++ /dev/null @@ -1 +0,0 @@ -{ bar = "regular"; foo = "directory"; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220122.exp b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220122.exp new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220122.exp @@ -0,0 +1 @@ +3 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220122.nix b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220122.nix new file mode 100644 index 0000000000..694e9a13b7 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220122.nix @@ -0,0 +1 @@ +((_: _) 1) + ((__: __) 2) diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220125.exp b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220125.exp new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220125.exp @@ -0,0 +1 @@ +3 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220125.nix b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220125.nix new file mode 100644 index 0000000000..4855023739 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-regression-20220125.nix @@ -0,0 +1,2 @@ +((__curPosFoo: __curPosFoo) 1) + ((__curPosBar: __curPosBar) 2) + 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 72e8274d8c..0000000000 --- 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-sort.exp b/tvix/eval/src/tests/nix_tests/eval-okay-sort.exp index 148b935163..899119e20e 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-sort.exp +++ b/tvix/eval/src/tests/nix_tests/eval-okay-sort.exp @@ -1 +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"; } ] ] +[ [ 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"; } ] [ [ ] [ ] [ 1 ] [ 1 4 ] [ 1 5 ] [ 1 6 ] [ 2 ] [ 2 3 ] [ 3 ] [ 3 ] ] ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix b/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix index 8299c3a4a3..50aa78e403 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix +++ b/tvix/eval/src/tests/nix_tests/eval-okay-sort.nix @@ -4,5 +4,17 @@ with builtins; (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"; } ]) + [ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ]) + (sort lessThan [ + [ 1 6 ] + [ ] + [ 2 3 ] + [ 3 ] + [ 1 5 ] + [ 2 ] + [ 1 ] + [ ] + [ 1 4 ] + [ 3 ] + ]) ] 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 index f7393e847d..f7393e847d 100644 --- 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 diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-versions.nix b/tvix/eval/src/tests/nix_tests/eval-okay-versions.nix index e63c36586b..e9111f5f43 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-versions.nix +++ b/tvix/eval/src/tests/nix_tests/eval-okay-versions.nix @@ -4,6 +4,7 @@ let name2 = "hello"; name3 = "915resolution-0.5.2"; name4 = "xf86-video-i810-1.7.4"; + name5 = "name-that-ends-with-dash--1.0"; eq = 0; lt = builtins.sub 0 1; @@ -23,6 +24,8 @@ let ((builtins.parseDrvName name3).version == "0.5.2") ((builtins.parseDrvName name4).name == "xf86-video-i810") ((builtins.parseDrvName name4).version == "1.7.4") + ((builtins.parseDrvName name5).name == "name-that-ends-with-dash") + ((builtins.parseDrvName name5).version == "-1.0") (versionTest "1.0" "2.3" lt) (versionTest "2.1" "2.3" lt) (versionTest "2.3" "2.3" eq) 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 index 92b75e0b8b..20099326cc 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-xml.exp.xml +++ b/tvix/eval/src/tests/nix_tests/eval-okay-xml.exp.xml @@ -31,9 +31,9 @@ <attr name="f"> <function> <attrspat> - <attr name="z" /> <attr name="x" /> <attr name="y" /> + <attr name="z" /> </attrspat> </function> </attr> diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-bad-antiquote-2.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix index 3745235ce9..3745235ce9 100644 --- a/tvix/eval/src/tests/nix_tests/eval-fail-bad-antiquote-2.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-fromTOML-timestamps.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-fromTOML-timestamps.nix new file mode 100644 index 0000000000..74cff9470a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-fromTOML-timestamps.nix @@ -0,0 +1,130 @@ +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 + + 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" +'' diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-antiquoted-path.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-nonexist-path.nix index f2f08107b5..f2f08107b5 100644 --- a/tvix/eval/src/tests/nix_tests/eval-fail-antiquoted-path.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-nonexist-path.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-scope-5.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix index f89a65a99b..f89a65a99b 100644 --- a/tvix/eval/src/tests/nix_tests/eval-fail-scope-5.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-fail-undeclared-arg.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix index cafdf16362..cafdf16362 100644 --- a/tvix/eval/src/tests/nix_tests/eval-fail-undeclared-arg.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp index b46938032e..b46938032e 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix index 2e5c85483b..2e5c85483b 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-attrs6.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp index 7a8391786a..7a8391786a 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.flags b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags index 217c7a5ae2..217c7a5ae2 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.flags +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.nix index 815f51b1d6..815f51b1d6 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-autoargs.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.nix 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 0000000000..03b400cc88 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.exp @@ -0,0 +1 @@ +[ true true true true true 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 0000000000..50a78d946e --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.nix @@ -0,0 +1,41 @@ +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; + }; + }; + + combo-path = "${path}${drv.outPath}${drv.foo.outPath}${drv.drvPath}"; + legit-context = builtins.getContext combo-path; + + reconstructed-path = builtins.appendContext + (builtins.unsafeDiscardStringContext combo-path) + desired-context; + + # Eta rule for strings with context. + etaRule = str: + str == builtins.appendContext + (builtins.unsafeDiscardStringContext str) + (builtins.getContext str); + +in [ + (legit-context == desired-context) + (reconstructed-path == combo-path) + (etaRule "foo") + (etaRule drv.drvPath) + (etaRule drv.foo.outPath) + (etaRule (builtins.unsafeDiscardOutputDependency drv.drvPath)) +] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-context.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp index 2f535bdbc4..2f535bdbc4 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-context.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix index 7b9531cfe9..7b9531cfe9 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-context.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp index 65fd65b4d0..65fd65b4d0 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix index b79553df0b..b79553df0b 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-curpos.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp index 8e7c61ab8e..8e7c61ab8e 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.nix index 3fb023e1cd..3fb023e1cd 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-delayed-with.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp index ec04aab6ae..ec04aab6ae 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.nix index d526cb4a21..d526cb4a21 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-eq-derivations.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.nix diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.exp new file mode 100644 index 0000000000..81f80420b9 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.exp @@ -0,0 +1 @@ +"23;24;23;23" diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.nix new file mode 100644 index 0000000000..d76a0d86ea --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.nix @@ -0,0 +1,9 @@ +with import ./lib.nix; + +let + n1 = builtins.floor 23.5; + n2 = builtins.ceil 23.5; + n3 = builtins.floor 23; + n4 = builtins.ceil 23; +in + builtins.concatStringsSep ";" (map toString [ n1 n2 n3 n4 ]) diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.exp new file mode 100644 index 0000000000..08b3c69a6c --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.exp @@ -0,0 +1 @@ +{ "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"; ld1 = { _type = "timestamp"; value = "1979-05-27"; }; ldt1 = { _type = "timestamp"; value = "1979-05-27T07:32:00"; }; ldt2 = { _type = "timestamp"; value = "1979-05-27T00:32:00.999999"; }; lt1 = { _type = "timestamp"; value = "07:32:00"; }; lt2 = { _type = "timestamp"; value = "00:32:00.999999"; }; name = "Orange"; oct1 = 342391; oct2 = 493; odt1 = { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; }; odt2 = { _type = "timestamp"; value = "1979-05-27T00:32:00-07:00"; }; odt3 = { _type = "timestamp"; value = "1979-05-27T00:32:00.999999-07:00"; }; odt4 = { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; }; 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"; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.flags b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.flags new file mode 100644 index 0000000000..9ed39dc6ba --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.flags @@ -0,0 +1 @@ +--extra-experimental-features parse-toml-timestamps diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.nix new file mode 100644 index 0000000000..74cff9470a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.nix @@ -0,0 +1,130 @@ +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 + + 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" +'' diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.exp new file mode 100644 index 0000000000..7f9ac40e81 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.exp @@ -0,0 +1 @@ +{ column = 11; file = "eval-okay-getattrpos-functionargs.nix"; line = 2; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.nix new file mode 100644 index 0000000000..11d6bb0e3a --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.nix @@ -0,0 +1,4 @@ +let + fun = { foo }: {}; + pos = builtins.unsafeGetAttrPos "foo" (builtins.functionArgs fun); +in { inherit (pos) column line; file = baseNameOf pos.file; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp index 19765bd501..19765bd501 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix index 14dd38f773..14dd38f773 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos-undefined.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp index 469249bbc6..469249bbc6 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix index ca6b079615..ca6b079615 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-getattrpos.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-import.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp index c508125b55..c508125b55 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-import.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-import.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.nix index 0b18d94131..76213a9541 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-import.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-import.nix @@ -6,6 +6,6 @@ let scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; builtins = builtins // overrides; - } // import ./lib.nix; + } // import ./../lib.nix; -in scopedImport overrides ./imported.nix +in scopedImport overrides ./../imported.nix diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp index 0cfbf08886..0cfbf08886 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix index 358742b36e..358742b36e 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-overrides.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.exp new file mode 100644 index 0000000000..5b8ea02438 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.exp @@ -0,0 +1 @@ +{ absolute = /foo; expr = /pwd/lang/foo/bar; home = /fake-home/foo; notfirst = /pwd/lang/bar/foo; simple = /pwd/lang/foo; slashes = /foo/bar; surrounded = /pwd/lang/a-foo-b; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.nix new file mode 100644 index 0000000000..497d7c1c75 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.nix @@ -0,0 +1,12 @@ +let + foo = "foo"; +in +{ + simple = ./${foo}; + surrounded = ./a-${foo}-b; + absolute = /${foo}; + expr = ./${foo + "/bar"}; + home = ~/${foo}; + notfirst = ./bar/${foo}; + slashes = /${foo}/${"bar"}; +} diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-path.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix index e67168cf3e..e67168cf3e 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-path.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readDir.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readDir.exp new file mode 100644 index 0000000000..6413f6d4f9 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readDir.exp @@ -0,0 +1 @@ +{ bar = "regular"; foo = "directory"; ldir = "symlink"; linked = "symlink"; } diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-readDir.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readDir.nix.disabled index a7ec9292aa..a7ec9292aa 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-readDir.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readDir.nix.disabled diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.exp new file mode 100644 index 0000000000..6413f6d4f9 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.exp @@ -0,0 +1 @@ +{ bar = "regular"; foo = "directory"; ldir = "symlink"; linked = "symlink"; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.nix new file mode 100644 index 0000000000..174fb6c3a0 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.nix @@ -0,0 +1,6 @@ +{ + bar = builtins.readFileType ./readDir/bar; + foo = builtins.readFileType ./readDir/foo; + linked = builtins.readFileType ./readDir/linked; + ldir = builtins.readFileType ./readDir/ldir; +} 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 0000000000..eac67c5fed --- /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" "fubar" ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.nix index bd8031fc00..a803e65199 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-replacestrings.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.nix @@ -8,4 +8,5 @@ with builtins; (replaceStrings [""] ["X"] "abc") (replaceStrings [""] ["X"] "") (replaceStrings ["-"] ["_"] "a-b") + (replaceStrings ["oo" "XX"] ["u" (throw "unreachable")] "foobar") ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp index 4519bc406d..4519bc406d 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.exp +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.flags b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags index a28e682100..a28e682100 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.flags +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.nix index cca41f821f..6fe33decc0 100644 --- a/tvix/eval/src/tests/nix_tests/eval-okay-search-path.nix +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.nix @@ -1,10 +1,9 @@ with import ./lib.nix; with builtins; -assert pathExists <nix/buildenv.nix>; +assert isFunction (import <nix/fetchurl.nix>); -assert length __nixPath == 6; -assert length (filter (x: x.prefix == "nix") __nixPath) == 1; +assert length __nixPath == 5; assert length (filter (x: baseNameOf x.path == "dir4") __nixPath) == 1; import <a.nix> + import <b.nix> + import <c.nix> + import <dir5/c.nix> diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.exp new file mode 100644 index 0000000000..9c0b15d22b --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.exp @@ -0,0 +1 @@ +{ "0" = { n = "0"; v = [ 5 23 29 ]; }; "1" = { n = "1"; v = [ 7 30 ]; }; "2" = { n = "2"; v = [ 18 ]; }; "4" = { n = "4"; v = [ 10 ]; }; "5" = { n = "5"; v = [ 15 25 26 31 ]; }; "6" = { n = "6"; v = [ 3 14 ]; }; "7" = { n = "7"; v = [ 12 ]; }; "8" = { n = "8"; v = [ 2 6 8 9 ]; }; "9" = { n = "9"; v = [ 0 16 ]; }; a = { n = "a"; v = [ 17 21 22 27 ]; }; c = { n = "c"; v = [ 11 24 ]; }; d = { n = "d"; v = [ 4 13 28 ]; }; e = { n = "e"; v = [ 20 ]; }; f = { n = "f"; v = [ 1 19 ]; }; } diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.nix new file mode 100644 index 0000000000..e5d4cdccb7 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.nix @@ -0,0 +1,9 @@ +with import ./../lib.nix; + +let + str = builtins.hashString "sha256" "test"; +in +builtins.zipAttrsWith + (n: v: { inherit n v; }) + (map (n: { ${builtins.substring n 1 str} = n; }) + (range 0 31)) diff --git a/tvix/eval/src/tests/nix_tests/readDir/bar b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/bar index e69de29bb2..e69de29bb2 100644 --- a/tvix/eval/src/tests/nix_tests/readDir/bar +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/bar diff --git a/tvix/eval/src/tests/nix_tests/readDir/foo/git-hates-directories b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/foo/git-hates-directories index e69de29bb2..e69de29bb2 100644 --- a/tvix/eval/src/tests/nix_tests/readDir/foo/git-hates-directories +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/foo/git-hates-directories diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/ldir b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/ldir new file mode 120000 index 0000000000..1910281566 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/ldir @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/linked b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/linked new file mode 120000 index 0000000000..c503f86a0c --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/linked @@ -0,0 +1 @@ +foo/git-hates-directories \ No newline at end of file diff --git a/tvix/eval/src/tests/nix_tests/parse-fail-eof-in-string.nix b/tvix/eval/src/tests/nix_tests/parse-fail-eof-in-string.nix new file mode 100644 index 0000000000..19775d2ec8 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/parse-fail-eof-in-string.nix @@ -0,0 +1,3 @@ +# https://github.com/NixOS/nix/issues/6562 +# Note that this file must not end with a newline. +a 1"$ \ No newline at end of file diff --git a/tvix/eval/src/tests/nix_tests/parse-okay-url.nix b/tvix/eval/src/tests/nix_tests/parse-okay-url.nix index fce3b13ee6..08de27d0a4 100644 --- a/tvix/eval/src/tests/nix_tests/parse-okay-url.nix +++ b/tvix/eval/src/tests/nix_tests/parse-okay-url.nix @@ -3,5 +3,6 @@ http://www2.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2 http://losser.st-lab.cs.uu.nl/~armijn/.nix/gcc-3.3.4-static-nix.tar.gz http://fpdownload.macromedia.com/get/shockwave/flash/english/linux/7.0r25/install_flash_player_7_linux.tar.gz + https://ftp5.gwdg.de/pub/linux/archlinux/extra/os/x86_64/unzip-6.0-14-x86_64.pkg.tar.zst ftp://ftp.gtk.org/pub/gtk/v1.2/gtk+-1.2.10.tar.gz ] |