aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-31 19:16:40 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-01-31 19:16:40 +0100
commit8414685c0f0c0d744c70d438894e4ecd7a078808 (patch)
tree3c7ca4bf6116f0d7dc863f4737518213767e7455 /tests
parentdbefe9e6b8e4db54be0bd63d3318019d0e3043ac (diff)
Change lock file format to use an attribute representation of flake refs rather than URLs
Diffstat (limited to 'tests')
-rw-r--r--tests/flakes.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/flakes.sh b/tests/flakes.sh
index 4642a7c2e..570f4f468 100644
--- a/tests/flakes.sh
+++ b/tests/flakes.sh
@@ -477,7 +477,7 @@ cat > $flake3Dir/flake.nix <<EOF
EOF
nix flake update $flake3Dir
-[[ $(jq .inputs.foo.url $flake3Dir/flake.lock) = $(jq .inputs.bar.url $flake3Dir/flake.lock) ]]
+[[ $(jq .inputs.foo.resolvedRef $flake3Dir/flake.lock) = $(jq .inputs.bar.resolvedRef $flake3Dir/flake.lock) ]]
cat > $flake3Dir/flake.nix <<EOF
{
@@ -491,7 +491,7 @@ cat > $flake3Dir/flake.nix <<EOF
EOF
nix flake update $flake3Dir
-[[ $(jq .inputs.bar.url $flake3Dir/flake.lock) =~ flake1 ]]
+[[ $(jq .inputs.bar.resolvedRef.url $flake3Dir/flake.lock) =~ flake1 ]]
cat > $flake3Dir/flake.nix <<EOF
{
@@ -505,7 +505,7 @@ cat > $flake3Dir/flake.nix <<EOF
EOF
nix flake update $flake3Dir
-[[ $(jq .inputs.bar.url $flake3Dir/flake.lock) =~ flake2 ]]
+[[ $(jq .inputs.bar.resolvedRef.url $flake3Dir/flake.lock) =~ flake2 ]]
# Test overriding inputs of inputs.
cat > $flake3Dir/flake.nix <<EOF
@@ -520,7 +520,7 @@ cat > $flake3Dir/flake.nix <<EOF
EOF
nix flake update $flake3Dir
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake7 ]]
+[[ $(jq .inputs.flake2.inputs.flake1.resolvedRef.url $flake3Dir/flake.lock) =~ flake7 ]]
cat > $flake3Dir/flake.nix <<EOF
{
@@ -535,7 +535,7 @@ cat > $flake3Dir/flake.nix <<EOF
EOF
nix flake update $flake3Dir --recreate-lock-file
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake7 ]]
+[[ $(jq .inputs.flake2.inputs.flake1.resolvedRef.url $flake3Dir/flake.lock) =~ flake7 ]]
# Test Mercurial flakes.
if [[ -z $(type -p hg) ]]; then
@@ -603,20 +603,20 @@ nix build -o $TEST_ROOT/result "file://$TEST_ROOT/flake.tar.gz?narHash=sha256-qQ
# Test --override-input.
git -C $flake3Dir reset --hard
nix flake update $flake3Dir --override-input flake2/flake1 flake5
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake5 ]]
+[[ $(jq .inputs.flake2.inputs.flake1.resolvedRef.url $flake3Dir/flake.lock) =~ flake5 ]]
nix flake update $flake3Dir --override-input flake2/flake1 flake1
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake1.*rev=$hash2 ]]
+[[ $(jq -r .inputs.flake2.inputs.flake1.resolvedRef.rev $flake3Dir/flake.lock) =~ $hash2 ]]
nix flake update $flake3Dir --override-input flake2/flake1 flake1/master/$hash1
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake1.*rev=$hash1 ]]
+[[ $(jq -r .inputs.flake2.inputs.flake1.resolvedRef.rev $flake3Dir/flake.lock) =~ $hash1 ]]
# Test --update-input.
nix flake update $flake3Dir
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake1.*rev=$hash1 ]]
+[[ $(jq -r .inputs.flake2.inputs.flake1.resolvedRef.rev $flake3Dir/flake.lock) = $hash1 ]]
nix flake update $flake3Dir --update-input flake2/flake1
-[[ $(jq .inputs.flake2.inputs.flake1.url $flake3Dir/flake.lock) =~ flake1.*rev=$hash2 ]]
+[[ $(jq -r .inputs.flake2.inputs.flake1.resolvedRef.rev $flake3Dir/flake.lock) =~ $hash2 ]]
# Test 'nix flake list-inputs'.
[[ $(nix flake list-inputs $flake3Dir | wc -l) == 5 ]]