fixup test
Some checks failed
pr / test (pull_request) Failing after 1m31s
lint / lint (pull_request) Successful in 10m44s

This commit is contained in:
2024-03-01 21:39:31 +03:00
parent f6f67af8d0
commit 3cd8bc33d6
2 changed files with 88 additions and 66 deletions

View File

@@ -22,13 +22,14 @@ func TestClient(t *testing.T) {
c2 := client.NewClient(client.Name("test2"))
svc := NewService(Client(c1, c2))
if err := svc.Init(); err != nil {
t.Fatal(err)
}
x1 := svc.Client("test2")
if x1.Name() != "test2" {
t.Fatal("invalid client")
t.Fatalf("invalid client %#+v", svc.Options().Clients)
}
}
@@ -40,15 +41,6 @@ func (ti *testItem) Name() string {
return ti.name
}
func TestGetNameIndex(t *testing.T) {
item1 := &testItem{name: "first"}
item2 := &testItem{name: "second"}
items := []interface{}{item1, item2}
if idx := getNameIndex("second", items); idx != 1 {
t.Fatalf("getNameIndex func error, item not found")
}
}
func TestRegisterHandler(t *testing.T) {
type args struct {
s server.Server