diff options
author | tomberek <tomberek@users.noreply.github.com> | 2022-01-28 10:18:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 10:18:29 -0500 |
commit | 2bf96bd9f299885b38cafa460a06c77f0c296dfe (patch) | |
tree | ea5509fce38534d28d13984d1171385a9dc9a122 /tests | |
parent | 73e82ae954be991858053df2a6b7323fe3a82c36 (diff) | |
parent | 4bf6af7b555033de5c1d6851edb60a91940d43c3 (diff) |
Merge branch 'master' into bundler_drv
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/eval-okay-regression-20220125.exp | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-regression-20220125.nix | 2 | ||||
-rw-r--r-- | tests/local.mk | 2 | ||||
-rw-r--r-- | tests/nix_path.sh | 11 | ||||
-rw-r--r-- | tests/store-ping.sh | 13 |
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" |