tests/functional2/lang: Refactor test outputs

How long do we have the value printer already? It's time to stop
concatenating strings like it's 2005

Change-Id: I3f5074de2439a1ad78af94de877bb141bc9f1d82
This commit is contained in:
piegames
2025-11-24 16:31:29 +01:00
parent 0167bf56f5
commit 45e4bec59e
27 changed files with 195 additions and 244 deletions
@@ -1 +1 @@
2216
[ 1275 579 -11 5 3 11 60 228 20 8 14 6 ]
+33 -33
View File
@@ -16,44 +16,44 @@ let
err = abort "urgh";
in
sum
[ (sum (range 1 50))
(123 + 456)
(0 + -10 + -(-11) + -x)
(10 - 7 - -2)
(10 - (6 - -1))
(10 - 1 + 2)
(3 * 4 * 5)
(56088 / 123 / 2)
(3 + 4 * const 5 0 - 6 / id 2)
(builtins.bitAnd 12 10) # 0b1100 & 0b1010 = 8
(builtins.bitOr 12 10) # 0b1100 | 0b1010 = 14
(builtins.bitXor 12 10) # 0b1100 ^ 0b1010 = 6
assert 3 < 7;
assert !(7 < 3);
assert !(3 < 3);
(if 3 < 7 then 1 else err)
(if 7 < 3 then err else 1)
(if 3 < 3 then err else 1)
assert 3 <= 7;
assert !(7 <= 3);
assert 3 <= 3;
(if 3 <= 7 then 1 else err)
(if 7 <= 3 then err else 1)
(if 3 <= 3 then 1 else err)
assert !(3 > 7);
assert 7 > 3;
assert !(3 > 3);
(if 3 > 7 then err else 1)
(if 7 > 3 then 1 else err)
(if 3 > 3 then err else 1)
assert !(3 >= 7);
assert 7 >= 3;
assert 3 >= 3;
(if 3 >= 7 then err else 1)
(if 7 >= 3 then 1 else err)
(if 3 >= 3 then 1 else err)
assert 2 > 1 == 1 < 2;
assert 1 + 2 * 3 >= 7;
assert !(1 + 2 * 3 < 7);
(if 2 > 1 == 1 < 2 then 1 else err)
(if 1 + 2 * 3 >= 7 then 1 else err)
(if 1 + 2 * 3 < 7 then err else 1)
# Not integer, but so what.
assert "aa" < "ab";
assert !("aa" < "aa");
assert "foo" < "foobar";
[
(sum (range 1 50))
(123 + 456)
(0 + -10 + -(-11) + -x)
(10 - 7 - -2)
(10 - (6 - -1))
(10 - 1 + 2)
(3 * 4 * 5)
(56088 / 123 / 2)
(3 + 4 * const 5 0 - 6 / id 2)
# Not integer, but so what.
(if "aa" < "ab" then 1 else err)
(if "aa" < "aa" then err else 1)
(if "foo" < "foobar" then 1 else err)
]
(builtins.bitAnd 12 10) # 0b1100 & 0b1010 = 8
(builtins.bitOr 12 10) # 0b1100 | 0b1010 = 14
(builtins.bitXor 12 10) # 0b1100 ^ 0b1010 = 6
]
@@ -14,30 +14,28 @@ let
let d1 = builtins.compareVersions v1 v2;
d2 = builtins.compareVersions v2 v1;
in d1 == builtins.sub 0 d2 && d1 == expected;
in
tests = [
((builtins.parseDrvName name1).name == "hello")
((builtins.parseDrvName name1).version == "1.0.2")
((builtins.parseDrvName name2).name == "hello")
((builtins.parseDrvName name2).version == "")
((builtins.parseDrvName name3).name == "915resolution")
((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)
(versionTest "2.5" "2.3" gt)
(versionTest "3.1" "2.3" gt)
(versionTest "2.3.1" "2.3" gt)
(versionTest "2.3.1" "2.3a" gt)
(versionTest "2.3pre1" "2.3" lt)
(versionTest "2.3pre3" "2.3pre12" lt)
(versionTest "2.3a" "2.3c" lt)
(versionTest "2.3pre1" "2.3c" lt)
(versionTest "2.3pre1" "2.3q" lt)
];
in (import ./lib.nix).and tests
assert (builtins.parseDrvName name1).name == "hello";
assert (builtins.parseDrvName name1).version == "1.0.2";
assert (builtins.parseDrvName name2).name == "hello";
assert (builtins.parseDrvName name2).version == "";
assert (builtins.parseDrvName name3).name == "915resolution";
assert (builtins.parseDrvName name3).version == "0.5.2";
assert (builtins.parseDrvName name4).name == "xf86-video-i810";
assert (builtins.parseDrvName name4).version == "1.7.4";
assert (builtins.parseDrvName name5).name == "name-that-ends-with-dash";
assert (builtins.parseDrvName name5).version == "-1.0";
assert versionTest "1.0" "2.3" lt;
assert versionTest "2.1" "2.3" lt;
assert versionTest "2.3" "2.3" eq;
assert versionTest "2.5" "2.3" gt;
assert versionTest "3.1" "2.3" gt;
assert versionTest "2.3.1" "2.3" gt;
assert versionTest "2.3.1" "2.3a" gt;
assert versionTest "2.3pre1" "2.3" lt;
assert versionTest "2.3pre3" "2.3pre12" lt;
assert versionTest "2.3a" "2.3c" lt;
assert versionTest "2.3pre1" "2.3c" lt;
assert versionTest "2.3pre1" "2.3q" lt;
true
@@ -1 +1 @@
"23;24;23;23"
[ "23" "24" "23" "23" ]
@@ -6,4 +6,4 @@ let
n3 = builtins.floor 23;
n4 = builtins.ceil 23;
in
builtins.concatStringsSep ";" (map toString [ n1 n2 n3 n4 ])
map toString [ n1 n2 n3 n4 ]
@@ -1 +1 @@
"AAbar"
[ "A" "A" "bar" ]
@@ -7,4 +7,4 @@ let
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
builtins.concatStringsSep "" (map (x: x.a) r.result) + x.foo
(map (x: x.a) r.result) ++ [ x.foo ]
@@ -1 +1 @@
"foobarblabarxyzzybar"
[ "foobar" "blabar" "xyzzybar" ]
+1 -1
View File
@@ -1 +1 @@
builtins.concatStringsSep "" (map (x: x + "bar") [ "foo" "bla" "xyzzy" ])
map (x: x + "bar") [ "foo" "bla" "xyzzy" ]
@@ -1,32 +1,33 @@
builtins.pathExists (./lib.nix)
&& builtins.pathExists (builtins.toPath ./lib.nix)
&& builtins.pathExists (builtins.toString ./lib.nix)
&& !builtins.pathExists (builtins.toString ./lib.nix + "/")
&& !builtins.pathExists (builtins.toString ./lib.nix + "/.")
assert builtins.pathExists (./lib.nix);
assert builtins.pathExists (builtins.toPath ./lib.nix);
assert builtins.pathExists (builtins.toString ./lib.nix);
assert !builtins.pathExists (builtins.toString ./lib.nix + "/");
assert !builtins.pathExists (builtins.toString ./lib.nix + "/.");
# FIXME
# && !builtins.pathExists (builtins.toString ./lib.nix + "/..")
# && !builtins.pathExists (builtins.toString ./lib.nix + "/a/..")
# && !builtins.pathExists (builtins.toString ./lib.nix + "/../lib.nix")
&& !builtins.pathExists (builtins.toString ./lib.nix + "/./")
&& !builtins.pathExists (builtins.toString ./lib.nix + "/./.")
&& builtins.pathExists (builtins.toString ./.. + "/test-home/lib.nix")
&& !builtins.pathExists (builtins.toString ./.. + "test-home/lib.nix")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/lib.nix")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/./lib.nix")
&& builtins.pathExists (builtins.toString ./.)
&& builtins.pathExists (builtins.toString ./. + "/")
&& builtins.pathExists (builtins.toString ./. + "/../test-home")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/.")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/./")
&& builtins.pathExists (builtins.toString ./. + "/../test-home//./")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/..")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/../")
&& builtins.pathExists (builtins.toString ./. + "/../test-home/..//")
&& builtins.pathExists (builtins.toPath (builtins.toString ./lib.nix))
&& !builtins.pathExists (builtins.toPath (builtins.toString ./bla.nix))
&& builtins.pathExists ./lib.nix
&& !builtins.pathExists ./bla.nix
&& builtins.pathExists ./symlink-resolution/foo/overlays/overlay.nix
&& builtins.pathExists ./symlink-resolution/broken
&& builtins.pathExists (builtins.toString ./symlink-resolution/foo/overlays + "/.")
# assert !builtins.pathExists (builtins.toString ./lib.nix + "/..");
# assert !builtins.pathExists (builtins.toString ./lib.nix + "/a/..");
# assert !builtins.pathExists (builtins.toString ./lib.nix + "/../lib.nix");
assert !builtins.pathExists (builtins.toString ./lib.nix + "/./");
assert !builtins.pathExists (builtins.toString ./lib.nix + "/./.");
assert builtins.pathExists (builtins.toString ./.. + "/test-home/lib.nix");
assert !builtins.pathExists (builtins.toString ./.. + "test-home/lib.nix");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/lib.nix");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/./lib.nix");
assert builtins.pathExists (builtins.toString ./.);
assert builtins.pathExists (builtins.toString ./. + "/");
assert builtins.pathExists (builtins.toString ./. + "/../test-home");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/.");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/./");
assert builtins.pathExists (builtins.toString ./. + "/../test-home//./");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/..");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/../");
assert builtins.pathExists (builtins.toString ./. + "/../test-home/..//");
assert builtins.pathExists (builtins.toPath (builtins.toString ./lib.nix));
assert !builtins.pathExists (builtins.toPath (builtins.toString ./bla.nix));
assert builtins.pathExists ./lib.nix;
assert !builtins.pathExists ./bla.nix;
assert builtins.pathExists ./symlink-resolution/foo/overlays/overlay.nix;
assert builtins.pathExists ./symlink-resolution/broken;
assert builtins.pathExists (builtins.toString ./symlink-resolution/foo/overlays + "/.");
true
@@ -1 +1 @@
"ooxfoobarybarzobaabbc_bad"
[ "oo" "foobar" "bar" "oba" "" "b" "" "bad" ]
@@ -5,19 +5,13 @@ let
s = "foobar";
in
substring 1 2 s
+ "x"
+ substring 0 (stringLength s) s
+ "y"
+ substring 3 100 s
+ "z"
+ substring 2 (sub (stringLength s) 3) s
+ "a"
+ substring 3 0 s
+ "b"
+ substring 3 1 s
+ "c"
+ substring 5 10 "perl"
+ "_"
+ substring 3 (-1) "tebbad"
[
(substring 1 2 s)
(substring 0 (stringLength s) s)
(substring 3 100 s)
(substring 2 (sub (stringLength s) 3) s)
(substring 3 0 s)
(substring 3 1 s)
(substring 5 10 "perl")
(substring 3 (-1) "tebbad")
]
@@ -1 +1 @@
"abcxyzDDDDEFijk"
[ "abc" "xyz" "DDD" "DEF" "ijk" ]
@@ -9,8 +9,10 @@ let
j = {x, y, z, ...}: x + y + z;
in
f {x = "a"; y = "b"; z = "c";} +
g {x = "x"; y = "y"; z = "z";} +
h {x = "D";} +
h {x = "D"; y = "E"; z = "F";} +
j {x = "i"; y = "j"; z = "k"; bla = "bla"; foo = "bar";}
[
(f {x = "a"; y = "b"; z = "c";})
(g {x = "x"; y = "y"; z = "z";})
(h {x = "D";})
(h {x = "D"; y = "E"; z = "F";})
(j {x = "i"; y = "j"; z = "k"; bla = "bla"; foo = "bar";})
]
@@ -1 +1 @@
"foobarblatest"
[ "foo" "bar" "bla" "test" ]
+1 -1
View File
@@ -1 +1 @@
builtins.concatStringsSep "" ["foo" "bar" "bla" "test"]
["foo" "bar" "bla" "test"]
@@ -1 +1 @@
"abccX"
[ "a" "b" "c" "c" "X" ]
+8 -2
View File
@@ -6,5 +6,11 @@ assert isFunction (import <nix/fetchurl.nix>);
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>
+ (let __nixPath = [ { path = ./dir2; } { path = ./dir1; } ]; in import <a.nix>)
[
(import <a.nix>)
(import <b.nix>)
(import <c.nix>)
(import <dir5/c.nix>)
(let __nixPath = [ { path = ./dir2; } { path = ./dir1; } ]; in import <a.nix>)
]
@@ -1 +1 @@
"This is an indented multi-line string\nliteral. An amount of whitespace at\nthe start of each line matching the minimum\nindentation of all lines in the string\nliteral together will be removed. Thus,\nin this case four spaces will be\nstripped from each line, even though\n THIS LINE is indented six spaces.\n\nAlso, empty lines don't count in the\ndetermination of the indentation level (the\nprevious empty line has indentation 0, but\nit doesn't matter).\nIf the string starts with whitespace\n followed by a newline, it's stripped, but\n that's not the case here. Two spaces are\n stripped because of the \" \" at the start. \nThis line is indented\na bit further.\nAnti-quotations, like so, are\nalso allowed.\n The \\ is not special here.\n' can be followed by any character except another ', e.g. 'x'.\nLikewise for $, e.g. $$ or $varName.\nBut ' followed by ' is special, as is $ followed by {.\nIf you want them, use anti-quotations: '', \${.\n Tabs are not interpreted as whitespace (since we can't guess\n what tab settings are intended), so don't use them.\n\tThis line starts with a space and a tab, so only one\n space will be stripped from each line.\nAlso note that if the last line (just before the closing ' ')\nconsists only of whitespace, it's ignored. But here there is\nsome non-whitespace stuff, so the line isn't removed. \nThis shows a hacky way to preserve an empty line after the start.\nBut there's no reason to do so: you could just repeat the empty\nline.\n Similarly you can force an indentation level,\n in this case to 2 spaces. This works because the anti-quote\n is significant (not whitespace).\nstart on network-interfaces\n\nstart script\n\n rm -f /var/run/opengl-driver\n ln -sf 123 /var/run/opengl-driver\n\n rm -f /var/log/slim.log\n \nend script\n\nenv SLIM_CFGFILE=abc\nenv SLIM_THEMESDIR=def\nenv FONTCONFIG_FILE=/etc/fonts/fonts.conf \t\t\t\t# !!! cleanup\nenv XKB_BINDIR=foo/bin \t\t\t\t# Needed for the Xkb extension.\nenv LD_LIBRARY_PATH=libX11/lib:libXext/lib:/usr/lib/ # related to xorg-sys-opengl - needed to load libglx for (AI)GLX support (for compiz)\n\nenv XORG_DRI_DRIVER_PATH=nvidiaDrivers/X11R6/lib/modules/drivers/ \n\nexec slim/bin/slim\nEscaping of ' followed by ': ''\nEscaping of $ followed by {: \${\nAnd finally to interpret \\n etc. as in a string: \n, \r, \t.\nfoo\n'bla'\nbar\ncut -d $'\\t' -f 1\nending dollar $$\n Lines without any indentation effectively disable the indentation\n stripping for the entire string:\n\n cat >$out/foo/data <<EOF\n lasjdöaxnasd\nasdom 12398\nä\"§Æẞ¢«»”alsd\nEOF\nEmpty lines with a bit of whitespace don't affect the indentation calculation:\n\nAnd empty lines with more whitespace will have whitespace in the string:\n \nUnless it's the last line:\n Indentation stripping\n must not be impressed by\nthe last line not being empty\t Nor by people\n weirdly mixing tabs\n\tand spaces\n\t"
[ "This is an indented multi-line string\nliteral. An amount of whitespace at\nthe start of each line matching the minimum\nindentation of all lines in the string\nliteral together will be removed. Thus,\nin this case four spaces will be\nstripped from each line, even though\n THIS LINE is indented six spaces.\n\nAlso, empty lines don't count in the\ndetermination of the indentation level (the\nprevious empty line has indentation 0, but\nit doesn't matter).\n" "If the string starts with whitespace\n followed by a newline, it's stripped, but\n that's not the case here. Two spaces are\n stripped because of the \" \" at the start. \n" "This line is indented\na bit further.\n" "Anti-quotations, like so, are\nalso allowed.\n" " The \\ is not special here.\n' can be followed by any character except another ', e.g. 'x'.\nLikewise for $, e.g. $$ or $varName.\nBut ' followed by ' is special, as is $ followed by {.\nIf you want them, use anti-quotations: '', \${.\n" " Tabs are not interpreted as whitespace (since we can't guess\n what tab settings are intended), so don't use them.\n\tThis line starts with a space and a tab, so only one\n space will be stripped from each line.\n" "Also note that if the last line (just before the closing ' ')\nconsists only of whitespace, it's ignored. But here there is\nsome non-whitespace stuff, so the line isn't removed. " "\nThis shows a hacky way to preserve an empty line after the start.\nBut there's no reason to do so: you could just repeat the empty\nline.\n" " Similarly you can force an indentation level,\n in this case to 2 spaces. This works because the anti-quote\n is significant (not whitespace).\n" "" "" "" "start on network-interfaces\n\nstart script\n\n rm -f /var/run/opengl-driver\n ln -sf 123 /var/run/opengl-driver\n\n rm -f /var/log/slim.log\n \nend script\n\nenv SLIM_CFGFILE=abc\nenv SLIM_THEMESDIR=def\nenv FONTCONFIG_FILE=/etc/fonts/fonts.conf \t\t\t\t# !!! cleanup\nenv XKB_BINDIR=foo/bin \t\t\t\t# Needed for the Xkb extension.\nenv LD_LIBRARY_PATH=libX11/lib:libXext/lib:/usr/lib/ # related to xorg-sys-opengl - needed to load libglx for (AI)GLX support (for compiz)\n\nenv XORG_DRI_DRIVER_PATH=nvidiaDrivers/X11R6/lib/modules/drivers/ \n\nexec slim/bin/slim\n" "Escaping of ' followed by ': ''\nEscaping of $ followed by {: \${\nAnd finally to interpret \\n etc. as in a string: \n, \r, \t.\n" "foo\n'bla'\nbar\n" "cut -d $'\\t' -f 1\n" "ending dollar $$\n" " Lines without any indentation effectively disable the indentation\n stripping for the entire string:\n\n cat >$out/foo/data <<EOF\n lasjdöaxnasd\nasdom 12398\nä\"§Æẞ¢«»”alsd\nEOF\n" "Empty lines with a bit of whitespace don't affect the indentation calculation:\n\nAnd empty lines with more whitespace will have whitespace in the string:\n \nUnless it's the last line:\n" " Indentation stripping\n must not be impressed by\nthe last line not being empty" "\t Nor by people\n weirdly mixing tabs\n\tand spaces\n\t" ]
@@ -155,4 +155,5 @@ EOF
# Accept dollars at end of strings
s17 = ''ending dollar $'' + ''$'' + "\n";
in s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10 + s11 + s12 + s13 + s14 + s15 + s16 + s17 + s18 + s19 + s20 + s21
in
[s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21]
@@ -330,105 +330,47 @@ attrs:
valueType: String
isInterpolation: true
body:
_type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprVar
value: s1
- _type: ExprVar
value: s2
isInterpolation: false
- _type: ExprVar
value: s3
isInterpolation: false
- _type: ExprVar
value: s4
isInterpolation: false
- _type: ExprVar
value: s5
isInterpolation: false
- _type: ExprVar
value: s6
isInterpolation: false
- _type: ExprVar
value: s7
isInterpolation: false
- _type: ExprVar
value: s8
isInterpolation: false
- _type: ExprVar
value: s9
isInterpolation: false
- _type: ExprVar
value: s10
isInterpolation: false
- _type: ExprVar
value: s11
isInterpolation: false
- _type: ExprVar
value: s12
isInterpolation: false
- _type: ExprVar
value: s13
isInterpolation: false
- _type: ExprVar
value: s14
isInterpolation: false
- _type: ExprVar
value: s15
isInterpolation: false
- _type: ExprVar
value: s16
isInterpolation: false
- _type: ExprVar
value: s17
isInterpolation: false
- _type: ExprVar
value: s18
isInterpolation: false
- _type: ExprVar
value: s19
isInterpolation: false
- _type: ExprVar
value: s20
isInterpolation: false
_type: ExprList
elems:
- _type: ExprVar
value: s1
- _type: ExprVar
value: s2
- _type: ExprVar
value: s3
- _type: ExprVar
value: s4
- _type: ExprVar
value: s5
- _type: ExprVar
value: s6
- _type: ExprVar
value: s7
- _type: ExprVar
value: s8
- _type: ExprVar
value: s9
- _type: ExprVar
value: s10
- _type: ExprVar
value: s11
- _type: ExprVar
value: s12
- _type: ExprVar
value: s13
- _type: ExprVar
value: s14
- _type: ExprVar
value: s15
- _type: ExprVar
value: s16
- _type: ExprVar
value: s17
- _type: ExprVar
value: s18
- _type: ExprVar
value: s19
- _type: ExprVar
value: s20
- _type: ExprVar
value: s21
isInterpolation: false
@@ -1 +1 @@
"foobar/a/b/c/d/foo/xyzzy/foo.txt/../foo/x/yescape: \"quote\" \n \\end\nof\nlinefoobarblaatfoo$bar$\"$\"$"
[ "foobar" "/a/b/c/d" "/foo/xyzzy/foo.txt" "/../foo/x/y" "escape: \"quote\" \n \\" "end\nof\nline" "foobarblaat" "foo$bar" "$\"$\"" "$" ]
+12 -10
View File
@@ -1,12 +1,14 @@
"foo" + "bar"
+ toString (/a/b + /c/d)
+ toString (/foo/bar + "/../xyzzy/." + "/foo.txt")
+ ("/../foo" + toString /x/y)
+ "escape: \"quote\" \n \\"
+ "end
[
("foo" + "bar")
(toString (/a/b + /c/d))
(toString (/foo/bar + "/../xyzzy/." + "/foo.txt"))
("/../foo" + toString /x/y)
"escape: \"quote\" \n \\"
"end
of
line"
+ "foo${if true then "b${"a" + "r"}" else "xyzzy"}blaat"
+ "foo$bar"
+ "$\"$\""
+ "$"
"foo${if true then "b${"a" + "r"}" else "xyzzy"}blaat"
"foo$bar"
"$\"$\""
"$"
]
@@ -1 +1 @@
"b-overridden b-overridden a"
[ "b-overridden" "b-overridden" "a" ]
@@ -1 +1 @@
"xyzzybarxyzzybar"
[ [ "xyzzy" "bar" ] [ "xyzzy" "bar" ] ]
@@ -26,4 +26,9 @@ let
pkgs = pkgs_ // (packageOverrides pkgs_);
in "${pkgs.a.b.name} ${pkgs.c.name} ${pkgs.b.a.name}"
in
[
pkgs.a.b.name
pkgs.c.name
pkgs.b.a.name
]
+3 -3
View File
@@ -11,9 +11,9 @@ let
a = "bar";
};
x = with as; a + b;
x = with as; [a b];
y = with as; with bs; a + b;
y = with as; with bs; [a b];
in
x + y
[x y]