From 8af972aad3c394275e1cbef91ed547e6bb91c362 Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Tue, 28 May 2019 08:20:00 -0700 Subject: [PATCH] Add route url test for schemes --- old_test.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/old_test.go b/old_test.go index b228983c..f088a951 100644 --- a/old_test.go +++ b/old_test.go @@ -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) { @@ -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) - */ } }