From 17d46041b8c68c66402296d23c3bccfe1731b17e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 12 Feb 2025 22:05:38 +0100 Subject: [PATCH] Add test --- tests/functional/tarball.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/functional/tarball.sh b/tests/functional/tarball.sh index 720b3688f..53807603c 100755 --- a/tests/functional/tarball.sh +++ b/tests/functional/tarball.sh @@ -73,13 +73,13 @@ test_tarball .gz gzip # All entries in tree.tar.gz refer to the same file, and all have the same inode when unpacked by GNU tar. # We don't preserve the hard links, because that's an optimization we think is not worth the complexity, # so we only make sure that the contents are copied correctly. -path="$(nix flake prefetch --json "tarball+file://$(pwd)/tree.tar.gz" | jq -r .storePath)" -[[ $(cat "$path/a/b/foo") = bar ]] -[[ $(cat "$path/a/b/xyzzy") = bar ]] -[[ $(cat "$path/a/yyy") = bar ]] -[[ $(cat "$path/a/zzz") = bar ]] -[[ $(cat "$path/c/aap") = bar ]] -[[ $(cat "$path/fnord") = bar ]] +nix flake prefetch --json "tarball+file://$(pwd)/tree.tar.gz" --out-link "$TEST_ROOT/result" +[[ $(cat "$TEST_ROOT/result/a/b/foo") = bar ]] +[[ $(cat "$TEST_ROOT/result/a/b/xyzzy") = bar ]] +[[ $(cat "$TEST_ROOT/result/a/yyy") = bar ]] +[[ $(cat "$TEST_ROOT/result/a/zzz") = bar ]] +[[ $(cat "$TEST_ROOT/result/c/aap") = bar ]] +[[ $(cat "$TEST_ROOT/result/fnord") = bar ]] # Test a tarball that has multiple top-level directories. rm -rf "$TEST_ROOT/tar_root"