aboutsummaryrefslogtreecommitdiff
path: root/dbstore/cpesearchtype_test.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-05 11:06:55 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-05 11:06:55 -0500
commit63a3351c9527f9f774862329b56f487339b09903 (patch)
tree2b43ecb72cc930fa1e84d843f96f6138dd84e8b4 /dbstore/cpesearchtype_test.go
parenta6d72e2f75064a3ab823449c912188d210a77feb (diff)
downloadcvez-63a3351c9527f9f774862329b56f487339b09903.tar.bz2
cvez-63a3351c9527f9f774862329b56f487339b09903.zip
dbstore: refactor, separate cpesearchrow and cpesearchtype, add cpesearchtype_test
Diffstat (limited to 'dbstore/cpesearchtype_test.go')
-rw-r--r--dbstore/cpesearchtype_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/dbstore/cpesearchtype_test.go b/dbstore/cpesearchtype_test.go
new file mode 100644
index 0000000..1421d3c
--- /dev/null
+++ b/dbstore/cpesearchtype_test.go
@@ -0,0 +1,24 @@
+package dbstore
+
+import "testing"
+
+func TestCpeSearchTypeString(t *testing.T) {
+ tests := []struct {
+ val CpeSearchType
+ exp string
+ } {
+ { CpeSearchAll, "cpe-search-all" },
+ { CpeSearchTitle, "cpe-search-title" },
+ { CpeSearchRef, "cpe-search-ref" },
+ { CpeSearchType(255), "CpeSearchType(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)
+ }
+ })
+ }
+}