Skip to content

Commit

Permalink
Updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cinar committed Jun 24, 2023
1 parent 83a2d0d commit 5cbb854
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,36 @@ func TestCheckURLInvalid(t *testing.T) {
URL string `checkers:"url"`
}

bookmark := &Bookmark{
URL: "zdo.com/index.html",
}

_, valid := checker.Check(bookmark)
if valid {
t.Fail()
}
}

func TestCheckURLWithoutSchema(t *testing.T) {
type Bookmark struct {
URL string `checkers:"url"`
}

bookmark := &Bookmark{
URL: "//zdo.com/index.html",
}

_, valid := checker.Check(bookmark)
if valid {
t.Fail()
}
}

func TestCheckURLWithoutHost(t *testing.T) {
type Bookmark struct {
URL string `checkers:"url"`
}

bookmark := &Bookmark{
URL: "https:://index.html",
}
Expand Down

0 comments on commit 5cbb854

Please sign in to comment.