2021-01-10 10:18:42 +03:00
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2021-01-29 16:47:26 +03:00
|
|
|
"github.com/unistack-org/micro/v3/register"
|
2021-01-10 10:18:42 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestStoreRegex(t *testing.T) {
|
|
|
|
t.Skip()
|
|
|
|
router, err := newRouter()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-01-29 16:47:26 +03:00
|
|
|
router.store([]*register.Service{
|
2021-01-10 10:18:42 +03:00
|
|
|
{
|
|
|
|
Name: "Foobar",
|
|
|
|
Version: "latest",
|
2021-01-29 16:47:26 +03:00
|
|
|
Endpoints: []*register.Endpoint{
|
2021-01-10 10:18:42 +03:00
|
|
|
{
|
|
|
|
Name: "foo",
|
|
|
|
Metadata: map[string]string{
|
|
|
|
"endpoint": "FooEndpoint",
|
|
|
|
"description": "Some description",
|
|
|
|
"method": "POST",
|
|
|
|
"path": "^/foo/$",
|
|
|
|
"handler": "rpc",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Metadata: map[string]string{},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
assert.Len(t, router.ceps["Foobar.foo"].pcreregs, 1)
|
|
|
|
}
|