diff options
Diffstat (limited to 'brokenlinks/brokenlinks_test.go')
| -rw-r--r-- | brokenlinks/brokenlinks_test.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/brokenlinks/brokenlinks_test.go b/brokenlinks/brokenlinks_test.go index f251165..ab857cd 100644 --- a/brokenlinks/brokenlinks_test.go +++ b/brokenlinks/brokenlinks_test.go @@ -223,11 +223,12 @@ func TestScan(t *testing.T) { if err != nil { t.Fatal(err) } + parsedTestUrl.Path = `/` parsedUrlBrokenHtml, err := url.Parse(testUrl + `/broken.html`) if err != nil { t.Fatal(err) } - parsedUrlPage2, err := url.Parse(testUrl + `/page2`) + parsedUrlPage2, err := url.Parse(testUrl + `/page2/`) if err != nil { t.Fatal(err) } @@ -254,7 +255,7 @@ func TestScan(t *testing.T) { opts: brokenlinks.Options{ Url: `http://127.0.0.1:14594`, }, - expError: `Scan: Get "http://127.0.0.1:14594": dial tcp 127.0.0.1:14594: connect: connection refused`, + expError: `Scan: Get "http://127.0.0.1:14594/": dial tcp 127.0.0.1:14594: connect: connection refused`, }, { desc: `With invalid IgnoreStatus`, opts: brokenlinks.Options{ @@ -270,14 +271,14 @@ func TestScan(t *testing.T) { }, expError: `Scan: Options: unknown status code "50"`, }, { - desc: `With Url=testUrl`, + desc: `With Url=` + testUrl, opts: brokenlinks.Options{ Url: testUrl, IgnoreStatus: `403`, Insecure: true, }, exp: map[string][]jarink.Link{ - testUrl: []jarink.Link{ + testUrl + `/`: []jarink.Link{ { ParentUrl: parsedTestUrl, Url: testUrl + `/broken.png`, @@ -337,7 +338,7 @@ func TestScan(t *testing.T) { Kind: int(atom.A), }, }, - testUrl + `/page2`: []jarink.Link{ + testUrl + `/page2/`: []jarink.Link{ { ParentUrl: parsedUrlPage2, Url: testUrl + `/broken.png`, @@ -359,12 +360,12 @@ func TestScan(t *testing.T) { }, { // Scanning on "/page2" should not scan the the "/" or other // pages other than below of "/page2" itself. - desc: `With Url=/page2`, + desc: `With Url=` + testUrl + `/page2`, opts: brokenlinks.Options{ Url: testUrl + `/page2`, }, exp: map[string][]jarink.Link{ - testUrl + `/page2`: []jarink.Link{ + testUrl + `/page2/`: []jarink.Link{ { ParentUrl: parsedUrlPage2, Url: testUrl + `/broken.png`, @@ -411,7 +412,7 @@ func TestScan(t *testing.T) { func TestScan_pastResult(t *testing.T) { var testUrl = `http://` + testAddress - parsedUrlPage2, err := url.Parse(testUrl + `/page2`) + parsedUrlPage2, err := url.Parse(testUrl + `/page2/`) if err != nil { t.Fatal(err) } @@ -438,7 +439,7 @@ func TestScan_pastResult(t *testing.T) { IgnoreStatus: `403`, }, exp: map[string][]jarink.Link{ - testUrl + `/page2`: []jarink.Link{ + testUrl + `/page2/`: []jarink.Link{ { ParentUrl: parsedUrlPage2, Url: testUrl + `/broken.png`, |
