aboutsummaryrefslogtreecommitdiff
path: root/tests/readfile-context.sh
blob: 31e70ddb1fc36cfbc526cdcf4b4a8d32e1880b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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!" ]