update libs
This commit is contained in:
1 parent
48cbb5c25d
commit
b1c16e4901
22 files changed
+301
-204
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package proxy //nolint
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_getPathWithoutPrefix(t *testing.T) {
|
||||
type args struct {
|
||||
path string
|
||||
prefix string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want string
|
||||
}{
|
||||
{name: "#1", args: args{
|
||||
path: "/api/some/11/22",
|
||||
prefix: "/api/some",
|
||||
}, want: "11/22"},
|
||||
{name: "#2", args: args{
|
||||
path: "/api/service/group/method",
|
||||
prefix: "/api",
|
||||
}, want: "service/group/method"},
|
||||
}
|
||||
for _, test := range tests {
|
||||
tt := test
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := getPathWithoutPrefix(tt.args.path, tt.args.prefix); got != tt.want {
|
||||
t.Errorf("getPathWithoutPrefix() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user