Skip to content

Commit

Permalink
Add route url test for schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
euank committed May 28, 2019
1 parent fc8f9b0 commit ca364df
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions old_test.go
Expand Up @@ -385,6 +385,11 @@ var urlBuildingTests = []urlBuildingTest{
vars: []string{"subdomain", "foo", "category", "technology", "id", "42"},
url: "http://foo.domain.com/articles/technology/42",
},
{
route: new(Route).Host("example.com").Schemes("https", "http"),
vars: []string{},
url: "https://example.com",
},
}

func TestHeaderMatcher(t *testing.T) {
Expand Down Expand Up @@ -502,18 +507,6 @@ func TestUrlBuilding(t *testing.T) {
url := u.String()
if url != v.url {
t.Errorf("expected %v, got %v", v.url, url)
/*
reversePath := ""
reverseHost := ""
if v.route.pathTemplate != nil {
reversePath = v.route.pathTemplate.Reverse
}
if v.route.hostTemplate != nil {
reverseHost = v.route.hostTemplate.Reverse
}
t.Errorf("%#v:\nexpected: %q\ngot: %q\nreverse path: %q\nreverse host: %q", v.route, v.url, url, reversePath, reverseHost)
*/
}
}

Expand Down

0 comments on commit ca364df

Please sign in to comment.