From 59945eac71e9a3d5955266dac902689cf8404a3c Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 19 Feb 2022 16:24:59 -0500 Subject: feed/cveid_test.go: update tests --- feed/cveid_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'feed') diff --git a/feed/cveid_test.go b/feed/cveid_test.go index 8df3642..400b1ad 100644 --- a/feed/cveid_test.go +++ b/feed/cveid_test.go @@ -43,7 +43,7 @@ func TestParseCveIdYear(t *testing.T) { } { { "0000", "year out of bounds: 0000" }, { "0001", "year out of bounds: 0001" }, - { "1999", "year out of bounds: 1999" }, + { "1998", "year out of bounds: 1998" }, { "2128", "year out of bounds: 2128" }, { "9999", "year out of bounds: 9999" }, } @@ -136,7 +136,7 @@ func TestNewCveId(t *testing.T) { exp string } { { "CVE-0000-1234", "year out of bounds: 0000" }, - { "CVE-1999-1234", "year out of bounds: 1999" }, + { "CVE-1998-1234", "year out of bounds: 1998" }, { "CVE-2128-1234", "year out of bounds: 2128" }, { "CVE-9999-1234", "year out of bounds: 9999" }, } @@ -170,10 +170,10 @@ func TestNewCveId(t *testing.T) { } goodTests := []string { - "CVE-2000-0", - "CVE-2127-0", - "CVE-2000-33554431", - "CVE-2127-33554431", + "CVE-1999-0", + "CVE-2126-0", + "CVE-1999-33554431", + "CVE-2126-33554431", } for _, val := range(goodTests) { @@ -185,7 +185,7 @@ func TestNewCveId(t *testing.T) { } } func TestCveIdYear(t *testing.T) { - for year := 2000; year < 2127; year++ { + for year := 1999; year < 2126; year++ { t.Run(strconv.FormatInt(int64(year), 10), func(t *testing.T) { // expected value exp := uint16(year) @@ -260,12 +260,12 @@ func TestCveIdUnmarshalValid(t *testing.T) { expNum uint32 exp string } { - { "\"CVE-2000-0\"", 2000, 0, "CVE-2000-0000" }, - { "\"CVE-2000-1234\"", 2000, 1234, "CVE-2000-1234" }, - { "\"CVE-2000-33554431\"", 2000, 33554431, "CVE-2000-33554431" }, - { "\"CVE-2127-0\"", 2127, 0, "CVE-2127-0000" }, - { "\"CVE-2127-1234\"", 2127, 1234, "CVE-2127-1234" }, - { "\"CVE-2127-33554431\"", 2127, 33554431, "CVE-2127-33554431" }, + { "\"CVE-1999-0\"", 1999, 0, "CVE-1999-0000" }, + { "\"CVE-1999-1234\"", 1999, 1234, "CVE-1999-1234" }, + { "\"CVE-1999-33554431\"", 1999, 33554431, "CVE-1999-33554431" }, + { "\"CVE-2126-0\"", 2126, 0, "CVE-2126-0000" }, + { "\"CVE-2126-1234\"", 2126, 1234, "CVE-2126-1234" }, + { "\"CVE-2126-33554431\"", 2126, 33554431, "CVE-2126-33554431" }, } for _, test := range(tests) { -- cgit v1.2.3