1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00
nix/tests/readfile-context.sh
2022-01-09 13:42:36 +03:00

17 lines
321 B
Bash

source common.sh
clearStore
outPath=$(nix-build --no-out-link readfile-context.nix)
# Set a GC root.
ln -s $outPath "$NIX_STATE_DIR"/gcroots/foo
# Check that file exists.
[ "$(cat $(cat $outPath))" = "Hello World!" ]
nix-collect-garbage
# Check that file still exists.
[ "$(cat $(cat $outPath))" = "Hello World!" ]