Loading pkgs/build-support/fetchurl/tests.nix +20 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ testers, fetchurl, writeShellScriptBin, writeText, jq, moreutils, emptyFile, Loading Loading @@ -148,4 +149,23 @@ in ]; hash = hello.src.outputHash; }; urls-mirrors = testers.invalidateFetcherByDrvHash fetchurl rec { name = "test-fetchurl-urls-simple"; urls = [ "http://broken" ] ++ hello.src.urls; hash = hello.src.outputHash; postFetch = hello.postFetch or "" + '' if ! diff -u ${ builtins.toFile "urls-resolved-by-eval" ( lib.concatStringsSep "\n" (lib.concatMap fetchurl.resolveUrl urls) + "\n" ) } <(printf '%s\n' "''${resolvedUrls[@]}"); then echo "ERROR: fetchurl: build-time-resolved URLs \`urls' differ from the evaluation-resolved URLs." >&2 exit 1 fi ''; }; } Loading
pkgs/build-support/fetchurl/tests.nix +20 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ testers, fetchurl, writeShellScriptBin, writeText, jq, moreutils, emptyFile, Loading Loading @@ -148,4 +149,23 @@ in ]; hash = hello.src.outputHash; }; urls-mirrors = testers.invalidateFetcherByDrvHash fetchurl rec { name = "test-fetchurl-urls-simple"; urls = [ "http://broken" ] ++ hello.src.urls; hash = hello.src.outputHash; postFetch = hello.postFetch or "" + '' if ! diff -u ${ builtins.toFile "urls-resolved-by-eval" ( lib.concatStringsSep "\n" (lib.concatMap fetchurl.resolveUrl urls) + "\n" ) } <(printf '%s\n' "''${resolvedUrls[@]}"); then echo "ERROR: fetchurl: build-time-resolved URLs \`urls' differ from the evaluation-resolved URLs." >&2 exit 1 fi ''; }; }