package cvss import "testing" func TestSeverityString(t *testing.T) { tests := []struct { val Severity exp string } { { None, "None" }, { Low, "Low" }, { Medium, "Medium" }, { High, "High" }, { Critical, "Critical" }, { Unknown, "Unknown" }, { Severity(255), "Severity(255)" }, } for _, test := range(tests) { t.Run(test.exp, func(t *testing.T) { got := test.val.String() if got != test.exp { t.Errorf("got \"%s\", exp \"%s\"", got, test.exp) } }) } }