diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-01-31 23:28:22 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-01-31 23:28:22 -0500 |
commit | 94b148ccdcb88f2544c222f73f5c734ac78ccd96 (patch) | |
tree | 23cfa33a5df29cdfb269f5f517217ff457f314fa /internal/cvss/version_test.go | |
parent | 5c4ff27a0bc70cdefad0c9a68e920e480465c4d9 (diff) | |
download | cvez-94b148ccdcb88f2544c222f73f5c734ac78ccd96.tar.bz2 cvez-94b148ccdcb88f2544c222f73f5c734ac78ccd96.zip |
internal/cvss: more tests
Diffstat (limited to 'internal/cvss/version_test.go')
-rw-r--r-- | internal/cvss/version_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/cvss/version_test.go b/internal/cvss/version_test.go new file mode 100644 index 0000000..e010094 --- /dev/null +++ b/internal/cvss/version_test.go @@ -0,0 +1,24 @@ +package cvss + +import "testing" + +func TestVersionString(t *testing.T) { + tests := []struct { + val Version + exp string + } { + { V20, "2.0" }, + { V30, "3.0" }, + { V31, "3.1" }, + { Version(255), "Version(255)" }, + } + + for _, test := range(tests) { + t.Run(test.val.String(), func(t *testing.T) { + got := test.val.String() + if got != test.exp { + t.Errorf("got: \"%s\", exp: \"%s\"", got, test.exp) + } + }) + } +} |