diff options
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests')
4 files changed, 15 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.exp new file mode 100644 index 000000000000..69667de5a1c3 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.exp @@ -0,0 +1 @@ +"{\"a\":40,\"b\":2}" diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.nix new file mode 100644 index 000000000000..70755c8c6dbe --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.nix @@ -0,0 +1,8 @@ +# Attribute sets with an `outPath` can contain _any_ serialisable +# value in that field. +builtins.toJSON { + outPath = { + a = 40; + b = 2; + }; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.exp new file mode 100644 index 000000000000..82dd08179843 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.exp @@ -0,0 +1 @@ +"\"/nix/store/jzka5ndnygkkfjfvpqwjipqp75lhz138-emacs-28.2\"" diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.nix new file mode 100644 index 000000000000..7f9d95ac60f4 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.nix @@ -0,0 +1,5 @@ +# Attribute sets with an `outPath` have that outPath itself serialised +# to string. +builtins.toJSON { + outPath = "/nix/store/jzka5ndnygkkfjfvpqwjipqp75lhz138-emacs-28.2"; +} |