aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authortomberek <tomberek@users.noreply.github.com>2022-01-28 10:18:29 -0500
committerGitHub <noreply@github.com>2022-01-28 10:18:29 -0500
commit2bf96bd9f299885b38cafa460a06c77f0c296dfe (patch)
treeea5509fce38534d28d13984d1171385a9dc9a122 /tests
parent73e82ae954be991858053df2a6b7323fe3a82c36 (diff)
parent4bf6af7b555033de5c1d6851edb60a91940d43c3 (diff)
Merge branch 'master' into bundler_drv
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/eval-okay-regression-20220125.exp1
-rw-r--r--tests/lang/eval-okay-regression-20220125.nix2
-rw-r--r--tests/local.mk2
-rw-r--r--tests/nix_path.sh11
-rw-r--r--tests/store-ping.sh13
5 files changed, 29 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-regression-20220125.exp b/tests/lang/eval-okay-regression-20220125.exp
new file mode 100644
index 000000000..00750edc0
--- /dev/null
+++ b/tests/lang/eval-okay-regression-20220125.exp
@@ -0,0 +1 @@
+3
diff --git a/tests/lang/eval-okay-regression-20220125.nix b/tests/lang/eval-okay-regression-20220125.nix
new file mode 100644
index 000000000..485502373
--- /dev/null
+++ b/tests/lang/eval-okay-regression-20220125.nix
@@ -0,0 +1,2 @@
+((__curPosFoo: __curPosFoo) 1) + ((__curPosBar: __curPosBar) 2)
+
diff --git a/tests/local.mk b/tests/local.mk
index 9c3e6bbd3..47717fa67 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -63,6 +63,8 @@ nix_tests = \
ca/nix-copy.sh \
eval-store.sh \
readfile-context.sh \
+ store-ping.sh \
+ nix_path.sh \
why-depends.sh
# parallel.sh
diff --git a/tests/nix_path.sh b/tests/nix_path.sh
new file mode 100644
index 000000000..d3657abf0
--- /dev/null
+++ b/tests/nix_path.sh
@@ -0,0 +1,11 @@
+# Regression for https://github.com/NixOS/nix/issues/5998 and https://github.com/NixOS/nix/issues/5980
+
+source common.sh
+
+export NIX_PATH=non-existent=/non-existent/but-unused-anyways:by-absolute-path=$PWD:by-relative-path=.
+
+nix-instantiate --eval -E '<by-absolute-path/simple.nix>' --restrict-eval
+nix-instantiate --eval -E '<by-relative-path/simple.nix>' --restrict-eval
+
+# Should ideally also test this, but there’s no pure way to do it, so just trust me that it works
+# nix-instantiate --eval -E '<nixpkgs>' -I nixpkgs=channel:nixos-unstable --restrict-eval
diff --git a/tests/store-ping.sh b/tests/store-ping.sh
new file mode 100644
index 000000000..f9427cf0a
--- /dev/null
+++ b/tests/store-ping.sh
@@ -0,0 +1,13 @@
+source common.sh
+
+STORE_INFO=$(nix store ping 2>&1)
+
+echo "$STORE_INFO" | grep "Store URL: ${NIX_REMOTE}"
+
+if [[ -v NIX_DAEMON_PACKAGE ]] && isDaemonNewer "2.7.0pre20220126"; then
+ DAEMON_VERSION=$($NIX_DAEMON_PACKAGE/bin/nix-daemon --version | cut -d' ' -f3)
+ echo "$STORE_INFO" | grep "Version: $DAEMON_VERSION"
+fi
+
+expect 127 NIX_REMOTE=unix:$PWD/store nix store ping || \
+ fail "nix store ping on a non-existent store should fail"