about summary refs log tree commit diff
path: root/tvix/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/cli/tests')
-rw-r--r--tvix/cli/tests/.skip-tree0
-rw-r--r--tvix/cli/tests/import.nix1
-rw-r--r--tvix/cli/tests/repl.rs16
-rw-r--r--tvix/cli/tests/six.nix1
4 files changed, 18 insertions, 0 deletions
diff --git a/tvix/cli/tests/.skip-tree b/tvix/cli/tests/.skip-tree
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/tvix/cli/tests/.skip-tree
diff --git a/tvix/cli/tests/import.nix b/tvix/cli/tests/import.nix
new file mode 100644
index 000000000000..9ac2d0232ec8
--- /dev/null
+++ b/tvix/cli/tests/import.nix
@@ -0,0 +1 @@
+{ }: import ./six.nix { }
diff --git a/tvix/cli/tests/repl.rs b/tvix/cli/tests/repl.rs
index a14f4bff7e6a..c6644330976e 100644
--- a/tvix/cli/tests/repl.rs
+++ b/tvix/cli/tests/repl.rs
@@ -53,6 +53,22 @@ test_repl!(bind_lazy() {
     "#]];
 });
 
+test_repl!(bind_lazy_errors() {
+    r#"x = (_: "x" + 1)"# => expect![[""]];
+    "x null" => expect![[""]];
+});
+
+test_repl!(bind_referencing_import() {
+    "six = import ./tests/six.nix {}" => expect![[""]];
+    "six.six" => expect![[r#"
+        => 6 :: int
+    "#]];
+    "imported = import ./tests/import.nix"  => expect![[""]];
+    "(imported {}).six" => expect![[r#"
+        => 6 :: int
+    "#]];
+});
+
 test_repl!(deep_print() {
     "builtins.map (x: x + 1) [ 1 2 3 ]" => expect![[r#"
         => [ <CODE> <CODE> <CODE> ] :: list
diff --git a/tvix/cli/tests/six.nix b/tvix/cli/tests/six.nix
new file mode 100644
index 000000000000..d466abe06a4c
--- /dev/null
+++ b/tvix/cli/tests/six.nix
@@ -0,0 +1 @@
+{ }: { six = builtins.foldl' (x: y: x + y) 0 [ 1 2 3 ]; }