aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/readfile-context.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/readfile-context.sh')
-rw-r--r--tests/functional/readfile-context.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/functional/readfile-context.sh b/tests/functional/readfile-context.sh
new file mode 100644
index 000000000..31e70ddb1
--- /dev/null
+++ b/tests/functional/readfile-context.sh
@@ -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!" ]