diff options
author | Robin Gloster <mail@glob.in> | 2019-10-27T09·15+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-01-04T13·10+0100 |
commit | 3130aafd0145c5c07f4557fe37f0c4d367e2d4f1 (patch) | |
tree | e3a4d542172a258b6926e454251752fac46ae4d7 /tests | |
parent | 6c90e3b9ac7c99d2ec4366363e99b9740470e41c (diff) |
builtins.toJSON: fix __toString usage
(cherry picked from commit e583df52800b4baa1564b027fe3b83a21756c2cc)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/eval-okay-tojson.exp | 2 | ||||
-rw-r--r-- | tests/lang/eval-okay-tojson.nix | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/tests/lang/eval-okay-tojson.exp b/tests/lang/eval-okay-tojson.exp index 33588493f75c..e92aae3235f2 100644 --- a/tests/lang/eval-okay-tojson.exp +++ b/tests/lang/eval-okay-tojson.exp @@ -1 +1 @@ -"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44}" +"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44,\"k\":\"foo\"}" diff --git a/tests/lang/eval-okay-tojson.nix b/tests/lang/eval-okay-tojson.nix index c046ba4ae59b..ce67943bead5 100644 --- a/tests/lang/eval-okay-tojson.nix +++ b/tests/lang/eval-okay-tojson.nix @@ -9,4 +9,5 @@ builtins.toJSON h = [ "a" [ "b" { "foo\nbar" = {}; } ] ]; i = 1 + 2; j = 1.44; + k = { __toString = self: self.a; a = "foo"; }; } |