Fix testcase

This commit is contained in:
Kota Kanbe
2017-05-04 16:27:00 +09:00
committed by kota kanbe
parent c103b79ec2
commit 17a4e532c1
5 changed files with 76 additions and 135 deletions

View File

@@ -116,7 +116,7 @@ func TestVulnInfosSetGet(t *testing.T) {
// var ps packageCveInfos
var ps VulnInfos
for _, cid := range test.in {
ps = ps.set(cid, VulnInfo{CveID: cid})
ps.Upsert(VulnInfo{CveID: cid})
}
if len(test.out) != len(ps) {
@@ -129,7 +129,7 @@ func TestVulnInfosSetGet(t *testing.T) {
}
}
for _, cid := range test.in {
p, _ := ps.FindByCveID(cid)
p, _ := ps.Get(cid)
if p.CveID != cid {
t.Errorf("expected %s, actual %s", cid, p.CveID)
}