Skip to content

Commit

Permalink
test for invalid oldURL in BuildURL
Browse files Browse the repository at this point in the history
  • Loading branch information
aryan-p03 committed Dec 31, 2024
1 parent 1bf31d4 commit 6c6b694
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions links/links_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,13 @@ func TestBuilder_BuildLink(t *testing.T) {

})

Convey("When an invalid old URL is provided", t, func() {
builder := &Builder{URL: &url.URL{Scheme: "http", Host: "localhost:8080"}}
invalidURL := ":invalid/url"
newurl, err := builder.BuildLink(invalidURL)
So(err, ShouldNotBeNil)
So(err.Error(), ShouldContainSubstring, "unable to parse link to URL")
So(newurl, ShouldBeEmpty)
})

}

0 comments on commit 6c6b694

Please sign in to comment.