about summary refs log tree commit diff
path: root/lib/tests/misc.nix
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2022-11-07 13:01:13 +0100
committerpennae <82953136+pennae@users.noreply.github.com>2022-12-08 17:52:52 +0100
commit0b661ce32af9baa07da56b3f48fcd3ef5611b66c (patch)
tree71056af5bcad19b694c5fcf980ba5180f9574f0f /lib/tests/misc.nix
parent0fa7b1b004788881733dc117edd7699f77384166 (diff)
lib/generators.toPretty: escape strings properly
Diffstat (limited to 'lib/tests/misc.nix')
-rw-r--r--lib/tests/misc.nix16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index 9267e1f57694c..cfad5a3cd92a0 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -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' = ''
         '''