mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Test relative store paths
This commit is contained in:
parent
fefd6c9e5f
commit
4178f36a1d
2 changed files with 21 additions and 1 deletions
20
tests/local-store.sh
Normal file
20
tests/local-store.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
source common.sh
|
||||
|
||||
cd $TEST_ROOT
|
||||
|
||||
echo example > example.txt
|
||||
mkdir -p ./x
|
||||
|
||||
NIX_STORE_DIR=$TEST_ROOT/x
|
||||
|
||||
CORRECT_PATH=$(nix-store --store ./x --add example.txt)
|
||||
|
||||
PATH1=$(nix path-info --store ./x $CORRECT_PATH)
|
||||
[ $CORRECT_PATH == $PATH1 ]
|
||||
|
||||
PATH2=$(nix path-info --store "$PWD/x" $CORRECT_PATH)
|
||||
[ $CORRECT_PATH == $PATH2 ]
|
||||
|
||||
# FIXME we could also test the query parameter version:
|
||||
# PATH3=$(nix path-info --store "local?store=$PWD/x" $CORRECT_PATH)
|
||||
# [ $CORRECT_PATH == $PATH3 ]
|
Loading…
Add table
Add a link
Reference in a new issue