mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
lib/generators.toPretty: escape strings properly
This commit is contained in:
parent
0fa7b1b004
commit
0b661ce32a
2 changed files with 21 additions and 19 deletions
|
@ -727,7 +727,7 @@ runTests {
|
|||
float = 0.1337;
|
||||
bool = true;
|
||||
emptystring = "";
|
||||
string = ''fno"rd'';
|
||||
string = "fn\${o}\"r\\d";
|
||||
newlinestring = "\n";
|
||||
path = /. + "/foo";
|
||||
null_ = null;
|
||||
|
@ -735,7 +735,7 @@ runTests {
|
|||
functionArgs = { arg ? 4, foo }: arg;
|
||||
list = [ 3 4 function [ false ] ];
|
||||
emptylist = [];
|
||||
attrs = { foo = null; "foo bar" = "baz"; };
|
||||
attrs = { foo = null; "foo b/ar" = "baz"; };
|
||||
emptyattrs = {};
|
||||
drv = deriv;
|
||||
};
|
||||
|
@ -744,7 +744,7 @@ runTests {
|
|||
float = "~0.133700";
|
||||
bool = "true";
|
||||
emptystring = ''""'';
|
||||
string = ''"fno\"rd"'';
|
||||
string = ''"fn\''${o}\"r\\d"'';
|
||||
newlinestring = "\"\\n\"";
|
||||
path = "/foo";
|
||||
null_ = "null";
|
||||
|
@ -752,7 +752,7 @@ runTests {
|
|||
functionArgs = "<function, args: {arg?, foo}>";
|
||||
list = "[ 3 4 ${function} [ false ] ]";
|
||||
emptylist = "[ ]";
|
||||
attrs = "{ foo = null; \"foo bar\" = \"baz\"; }";
|
||||
attrs = "{ foo = null; \"foo b/ar\" = \"baz\"; }";
|
||||
emptyattrs = "{ }";
|
||||
drv = "<derivation ${deriv.name}>";
|
||||
};
|
||||
|
@ -799,8 +799,8 @@ runTests {
|
|||
newlinestring = "\n";
|
||||
multilinestring = ''
|
||||
hello
|
||||
there
|
||||
test
|
||||
''${there}
|
||||
te'''st
|
||||
'';
|
||||
multilinestring' = ''
|
||||
hello
|
||||
|
@ -827,8 +827,8 @@ runTests {
|
|||
multilinestring = ''
|
||||
'''
|
||||
hello
|
||||
there
|
||||
test
|
||||
'''''${there}
|
||||
te''''st
|
||||
''''';
|
||||
multilinestring' = ''
|
||||
'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue