func TestInfoGetName(t *testing.T) { cases := []struct { name string expectedPlugin string expectedImage string }{ {"appv1", "appv1", ""}, {"bycontainer/ospaf/scan", "bycontainer", "ospaf/scan"}, } for _, c := range cases { info := snapshot.SnapshotInputInfo{Name: c.name} p, i := info.GetName() assert.Equal(t, c.expectedPlugin, p, "Fail to get plugin name") assert.Equal(t, c.expectedImage, i, "Fail to get image name") } }