aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/path-from-hash-part.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/path-from-hash-part.sh')
-rw-r--r--tests/functional/path-from-hash-part.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/functional/path-from-hash-part.sh b/tests/functional/path-from-hash-part.sh
new file mode 100644
index 000000000..bdd104434
--- /dev/null
+++ b/tests/functional/path-from-hash-part.sh
@@ -0,0 +1,10 @@
+source common.sh
+
+path=$(nix build --no-link --print-out-paths -f simple.nix)
+
+hash_part=$(basename $path)
+hash_part=${hash_part:0:32}
+
+path2=$(nix store path-from-hash-part $hash_part)
+
+[[ $path = $path2 ]]