mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
Merge pull request #1364 from BenLampson/master
Former-commit-id: 36560cd42e38af01ebe48e05745d71bbde981e12
This commit is contained in:
commit
655caea9bc
|
@ -51,7 +51,7 @@ func (l *methodLexer) reset(s string) {
|
|||
}
|
||||
|
||||
if end > 0 && len(s) >= end {
|
||||
words = append(words, s[start:end])
|
||||
words = append(words, s[start:])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -409,6 +409,10 @@ 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) GetLocationXY() {}
|
||||
func (c *testControllerRelPathFromFunc) GetLocationZBy(int) {}
|
||||
|
||||
func TestControllerRelPathFromFunc(t *testing.T) {
|
||||
app := iris.New()
|
||||
New(app).Handle(new(testControllerRelPathFromFunc))
|
||||
|
@ -449,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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user