mirror of
https://github.com/NixOS/nix
synced 2025-07-10 04:43:53 +02:00
Add test for readFile keeping context
This commit is contained in:
parent
c66865dff1
commit
120ca245d1
4 changed files with 38 additions and 1 deletions
16
tests/readfile-context.sh
Normal file
16
tests/readfile-context.sh
Normal file
|
@ -0,0 +1,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!" ]
|
Loading…
Add table
Add a link
Reference in a new issue