Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ runCommand, testers }: 2let 3 sitePkg = runCommand "site" { } '' 4 dist=$out/dist 5 mkdir -p $dist 6 echo "<html><body><a href=\"https://example.com/foo.html#foos-missing-anchor\">foo</a></body></html>" > $dist/index.html 7 echo "<html><body><a href=\".\">index</a></body></html>" > $dist/foo.html 8 ''; 9 10 linkCheck = testers.lycheeLinkCheck rec { 11 site = sitePkg + "/dist"; 12 remap = { 13 "https://exampl[e]\\.com" = site; 14 }; 15 }; 16 17 failure = testers.testBuildFailure linkCheck; 18 19in 20runCommand "link-check-fail" { inherit failure; } '' 21 grep -F foos-missing-anchor $failure/testBuildFailure.log >/dev/null 22 touch $out 23''