Skip to content

Commit

Permalink
Add a test for file: scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Sep 18, 2021
1 parent 01b82dc commit 03c4f89
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 11 additions & 2 deletions htmltest/check-link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,24 @@ func TestAnchorInternalBrokenIgnore(t *testing.T) {
tExpectIssueCount(t, hT, 0)
}

func TestAnchorInternalBrokenIgnoreUrl(t *testing.T) {
// ignores links in IgnoreURLs
func TestAnchorInternalIgnoreUrl(t *testing.T) {
// ignores internal links in IgnoreURLs
hT := tTestFileOpts("fixtures/links/brokenLinkInternal.html",
map[string]interface{}{
"IgnoreURLs": []interface{}{"no\\w+.html"},
})
tExpectIssueCount(t, hT, 0)
}

func TestAnchorFileIgnoreUrl(t *testing.T) {
// ignores file links in IgnoreURLs
hT := tTestFileOpts("fixtures/links/brokenLinkFile.html",
map[string]interface{}{
"IgnoreURLs": []interface{}{"no\\w+.html"},
})
tExpectIssueCount(t, hT, 0)
}

func TestAnchorInternalRelativeLinksBase(t *testing.T) {
// passes for relative links with a base
hT := tTestFile("fixtures/links/relativeLinksWithBase.html")
Expand Down
10 changes: 10 additions & 0 deletions htmltest/fixtures/links/brokenLinkFile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>

<body>

<p>Blah blah blah. <a href="file://a/b/c/notreal.html">Not a real link!</a></p>
<p id="safeHash">Blah blah blah. <a href="./missingLinkHref.html">A real link!</a></p>

</body>

</html>

0 comments on commit 03c4f89

Please sign in to comment.