opt: optimize redundant code (#103)

Signed-off-by: charlie <qianglin98@qq.com>
This commit is contained in:
charlie
2023-02-01 16:40:07 +08:00
committed by GitHub
parent 6c6cb0a8f3
commit 5ae9151d37
2 changed files with 33 additions and 135 deletions

View File

@@ -101,6 +101,19 @@ func TestGenerate(t *testing.T) {
generator: WasmpluginGenerator{},
isErr: false,
},
{
name: "ServiceEntry",
fn: func() (*model.PushContext, any) {
ctx := model.NewPushContext()
cfg := config.Config{
Spec: &networking.ServiceEntry{},
}
ctx.AllServiceEntries = []config.Config{cfg}
return ctx, cfg.Spec
},
generator: ServiceEntryGenerator{},
isErr: false,
},
{
name: "WasmPlugin with wrong config",
fn: func() (*model.PushContext, any) {