mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Add test
This commit is contained in:
parent
254b7afe66
commit
17d46041b8
1 changed files with 7 additions and 7 deletions
|
@ -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.
|
# 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,
|
# 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.
|
# 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)"
|
nix flake prefetch --json "tarball+file://$(pwd)/tree.tar.gz" --out-link "$TEST_ROOT/result"
|
||||||
[[ $(cat "$path/a/b/foo") = bar ]]
|
[[ $(cat "$TEST_ROOT/result/a/b/foo") = bar ]]
|
||||||
[[ $(cat "$path/a/b/xyzzy") = bar ]]
|
[[ $(cat "$TEST_ROOT/result/a/b/xyzzy") = bar ]]
|
||||||
[[ $(cat "$path/a/yyy") = bar ]]
|
[[ $(cat "$TEST_ROOT/result/a/yyy") = bar ]]
|
||||||
[[ $(cat "$path/a/zzz") = bar ]]
|
[[ $(cat "$TEST_ROOT/result/a/zzz") = bar ]]
|
||||||
[[ $(cat "$path/c/aap") = bar ]]
|
[[ $(cat "$TEST_ROOT/result/c/aap") = bar ]]
|
||||||
[[ $(cat "$path/fnord") = bar ]]
|
[[ $(cat "$TEST_ROOT/result/fnord") = bar ]]
|
||||||
|
|
||||||
# Test a tarball that has multiple top-level directories.
|
# Test a tarball that has multiple top-level directories.
|
||||||
rm -rf "$TEST_ROOT/tar_root"
|
rm -rf "$TEST_ROOT/tar_root"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue