aboutsummaryrefslogtreecommitdiff
path: root/dbstore/cpesearchtype_test.go
diff options
context:
space:
mode:
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)
+ }
+ })
+ }
+}