about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dump-db.sh1
-rw-r--r--tests/lang/parse-okay-regression-751.nix2
-rw-r--r--tests/repair.sh12
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/dump-db.sh b/tests/dump-db.sh
index 234b7ac02680..57c8c401600d 100644
--- a/tests/dump-db.sh
+++ b/tests/dump-db.sh
@@ -9,6 +9,7 @@ deps="$(nix-store -qR $TEST_ROOT/result)"
 nix-store --dump-db > $TEST_ROOT/dump
 
 rm -rf $NIX_DB_DIR
+mkdir $NIX_DB_DIR
 
 nix-store --load-db < $TEST_ROOT/dump
 
diff --git a/tests/lang/parse-okay-regression-751.nix b/tests/lang/parse-okay-regression-751.nix
new file mode 100644
index 000000000000..05c78b3016d3
--- /dev/null
+++ b/tests/lang/parse-okay-regression-751.nix
@@ -0,0 +1,2 @@
+let const = a: "const"; in
+''${ const { x = "q"; }}''
diff --git a/tests/repair.sh b/tests/repair.sh
index ae82b649c6ac..92f2f8fe60a5 100644
--- a/tests/repair.sh
+++ b/tests/repair.sh
@@ -18,6 +18,18 @@ if nix-store --verify --check-contents -v; then
     exit 1
 fi
 
+# The path can be repaired by rebuilding the derivation.
+nix-store --verify --check-contents --repair
+
+nix-store --verify-path $path2
+
+# Re-corrupt and delete the deriver. Now --verify --repair should
+# not work.
+chmod u+w $path2
+touch $path2/bad
+
+nix-store --delete $(nix-store -qd $path2)
+
 if nix-store --verify --check-contents --repair; then
     echo "nix-store --verify --repair succeeded unexpectedly" >&2
     exit 1