From d05eb19e1493422400f31a6d030eb1c9f8bb890c Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 19 Mar 2022 23:02:08 -0400 Subject: nvdmirror/syncconfig_test.go: fix TestSyncConfigGetMetas() --- nvdmirror/syncconfig_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nvdmirror/syncconfig_test.go b/nvdmirror/syncconfig_test.go index 91c900d..c00302b 100644 --- a/nvdmirror/syncconfig_test.go +++ b/nvdmirror/syncconfig_test.go @@ -163,29 +163,29 @@ func TestSyncConfigGetCweListUrl(t *testing.T) { } } -func TestSyncConfigGetMetaUrls(t *testing.T) { +func TestSyncConfigGetMetas(t *testing.T) { // declare expected result - exp := make(map[string]string) + exp := make(map[string]Update) // add years for year := 2002; year <= time.Now().Year(); year++ { k := fmt.Sprintf("%s/nvdcve-1.1-%04d.meta", testBaseUrl, year) v := fmt.Sprintf("%s/nvdcve-1.1-%04d.json.gz", testBaseUrl, year) - exp[k] = v + exp[k] = Update { Type: UpdateCveYear, Year: year, Url: v } } // add cve extra feeds for _, id := range([]string { "modified", "recent" }) { k := fmt.Sprintf("%s/nvdcve-1.1-%s.meta", testBaseUrl, id) v := fmt.Sprintf("%s/nvdcve-1.1-%s.json.gz", testBaseUrl, id) - exp[k] = v + exp[k] = Update { Type: UpdateCveMeta, Meta: id, Url: v } } { // add cpe match k := fmt.Sprintf("%s/nvdcpematch-1.0.meta", testBaseUrl) v := fmt.Sprintf("%s/nvdcpematch-1.0.json.gz", testBaseUrl) - exp[k] = v + exp[k] = Update { Type: UpdateCpeMatch, Url: v } } // declare custom config @@ -194,8 +194,8 @@ func TestSyncConfigGetMetaUrls(t *testing.T) { CpeMatch10BaseUrl: testBaseUrl, } - // get/check meta urls - got := config.getMetaUrls() + // get/check metas + got := config.getMetas() if !reflect.DeepEqual(got, exp) { t.Errorf("got \"%v\", exp \"%v\"", got, exp) } -- cgit v1.2.3