mirror of
https://github.com/kataras/iris.git
synced 2025-02-03 07:50:34 +01:00
9597fab37c
Former-commit-id: 96dd812a16338824474ba1be0db18c486b2ebc0d
23 lines
561 B
Go
23 lines
561 B
Go
package gorillamux_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gopkg.in/kataras/iris.v6"
|
|
"gopkg.in/kataras/iris.v6/adaptors/gorillamux"
|
|
)
|
|
|
|
func TestRouteURLPath(t *testing.T) {
|
|
app := iris.New()
|
|
app.Adapt(gorillamux.New())
|
|
|
|
app.None("/profile/{user_id}/{ref}/{anything:.*}", nil).ChangeName("profile")
|
|
app.Boot()
|
|
|
|
expected := "/profile/42/iris-go/something"
|
|
|
|
if got := app.Path("profile", "user_id", 42, "ref", "iris-go", "anything", "something"); got != expected {
|
|
t.Fatalf("gorillamux' reverse routing 'URLPath' error: expected %s but got %s", expected, got)
|
|
}
|
|
}
|