about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.nix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.nix
new file mode 100644
index 000000000000..8ae5e48e9737
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.nix
@@ -0,0 +1,14 @@
+map (e: (builtins.tryEval (builtins.toJSON e)).success) [
+  (builtins.throw "a")
+  {
+    a = builtins.throw "attribute a";
+  }
+  {
+    a.b.c.d.e.f.g.h.i = builtins.throw "deep i";
+  }
+  {
+    x = 32;
+    y = builtins.throw "second argument";
+  }
+  # FIXME(raitobezarius): we would like to test coercions, i.e. `toFile` and `derivation` containing throwables.
+]