nix-super/tests/functional/readfile-context.sh

19 lines
342 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2017-11-11 00:51:34 +02:00
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!" ]