From 0e1af3fef3ed478b0c4a85aa4dddb4cb42372d9c Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sat, 5 Oct 2019 22:24:35 +0300 Subject: [PATCH] add test case for https://github.com/kataras/iris/pull/1364 --- mvc/controller_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mvc/controller_test.go b/mvc/controller_test.go index 49d561e163..db9acfa8b3 100644 --- a/mvc/controller_test.go +++ b/mvc/controller_test.go @@ -409,8 +409,9 @@ func (c *testControllerRelPathFromFunc) GetSomethingByBy(string, int) {} func (c *testControllerRelPathFromFunc) GetSomethingNewBy(string, int) {} // two input arguments, one By which is the latest word. func (c *testControllerRelPathFromFunc) GetSomethingByElseThisBy(bool, int) {} // two input arguments -func (c *testControllerRelPathFromFunc) GetLocationX(){} -func (c *testControllerRelPathFromFunc) GetLocationXBy(int){} +func (c *testControllerRelPathFromFunc) GetLocationX() {} +func (c *testControllerRelPathFromFunc) GetLocationXY() {} +func (c *testControllerRelPathFromFunc) GetLocationZBy(int) {} func TestControllerRelPathFromFunc(t *testing.T) { app := iris.New() @@ -452,6 +453,13 @@ func TestControllerRelPathFromFunc(t *testing.T) { Body().Equal("GET:/42") e.GET("/anything/here").Expect().Status(iris.StatusOK). Body().Equal("GET:/anything/here") + + e.GET("/location/x").Expect().Status(iris.StatusOK). + Body().Equal("GET:/location/x") + e.GET("/location/x/y").Expect().Status(iris.StatusOK). + Body().Equal("GET:/location/x/y") + e.GET("/location/z/42").Expect().Status(iris.StatusOK). + Body().Equal("GET:/location/z/42") } type testControllerActivateListener struct {