about summary refs log tree commit diff
path: root/tvix/cli/tests/repl.rs
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-08-10T19·13-0400
committerclbot <clbot@tvl.fyi>2024-08-11T01·12+0000
commitf5c6acbbeb21ae36255ff03015d94000d4fc0030 (patch)
treec3f867845544052cc4ab52a18a78a992c53742de /tvix/cli/tests/repl.rs
parent7c2ac040dbb93b3cb3cacadd144709cf2866bbb5 (diff)
fix(tvix/cli): always configure nix path r/8476
Configure the nix path even if globals is already set.

Change-Id: I6598c92ab40ff952f73da04d9e7d3aeb13c16b53
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12176
Tested-by: BuildkiteCI
Autosubmit: aspen <root@gws.fyi>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Diffstat (limited to 'tvix/cli/tests/repl.rs')
-rw-r--r--tvix/cli/tests/repl.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/tvix/cli/tests/repl.rs b/tvix/cli/tests/repl.rs
index c6644330976e..7b9b9e34550a 100644
--- a/tvix/cli/tests/repl.rs
+++ b/tvix/cli/tests/repl.rs
@@ -9,7 +9,11 @@ macro_rules! test_repl {
         #[test]
         fn $name() {
             let tokio_runtime = tokio::runtime::Runtime::new().unwrap();
-            let args = tvix_cli::Args::parse_from(Vec::<OsString>::new());
+            let args = tvix_cli::Args::parse_from(vec![
+              OsString::from("tvix"),
+              OsString::from("--nix-search-path"),
+              OsString::from("nixpkgs=/tmp"),
+            ]);
             let mut repl = tvix_cli::Repl::new(init_io_handle(&tokio_runtime, &args), &args);
             $({
                 let result = repl.send($send.into());
@@ -83,3 +87,12 @@ test_repl!(explain() {
         => a 2-item attribute set
     "#]];
 });
+
+test_repl!(reference_nix_path() {
+    "<nixpkgs>" => expect![[r#"
+        => /tmp :: path
+    "#]];
+    "<nixpkgs>" => expect![[r#"
+        => /tmp :: path
+    "#]];
+});