diff --git a/tests/gc.sh b/tests/gc.sh
index a375a35c2eb62be745272a3f9a0977d917d8b0f7..0adb05bf173a76d8e7339124ddb66ab8f1e8fcd1 100644
--- a/tests/gc.sh
+++ b/tests/gc.sh
@@ -7,6 +7,8 @@ outPath=$(nix-store -rvv "$drvPath")
 rm -f "$NIX_STATE_DIR"/gcroots/foo
 ln -sf $outPath "$NIX_STATE_DIR"/gcroots/foo
 
+[ "$(nix-store -q --roots $outPath)" = "$NIX_STATE_DIR"/gcroots/foo ]
+
 nix-store --gc --print-roots | grep $outPath
 nix-store --gc --print-live | grep $outPath
 nix-store --gc --print-dead | grep $drvPath