aboutsummaryrefslogtreecommitdiff
path: root/dbstore
diff options
context:
space:
mode:
Diffstat (limited to 'dbstore')
-rw-r--r--dbstore/dbstore_test.go44
-rw-r--r--dbstore/sqlfs_test.go49
2 files changed, 49 insertions, 44 deletions
diff --git a/dbstore/dbstore_test.go b/dbstore/dbstore_test.go
index 6394035..09093c7 100644
--- a/dbstore/dbstore_test.go
+++ b/dbstore/dbstore_test.go
@@ -261,50 +261,6 @@ func TestInitFail(t *testing.T) {
}
}
-func TestGetQuery(t *testing.T) {
- tests := []struct {
- name string
- val string
- exp bool
- } {
- { "pass", "init", true },
- { "fail", "invalid", false },
- }
-
- for _, test := range(tests) {
- t.Run(test.name, func(t *testing.T) {
- got, err := getQuery(test.val)
- if err != nil && test.exp {
- t.Error(err)
- } else if err == nil && !test.exp {
- t.Errorf("got %v, exp error", got)
- }
- })
- }
-}
-
-func TestGetQueries(t *testing.T) {
- tests := []struct {
- name string
- vals []string
- exp bool
- } {
- { "pass", []string { "init" }, true },
- { "fail", []string { "invalid" }, false },
- }
-
- for _, test := range(tests) {
- t.Run(test.name, func(t *testing.T) {
- got, err := getQueries(test.vals)
- if err != nil && test.exp {
- t.Error(err)
- } else if err == nil && !test.exp {
- t.Errorf("got %v, exp error", got)
- }
- })
- }
-}
-
func TestAddCpeDictionaryPass(t *testing.T) {
if testing.Short() {
t.Skip("skipping TestAddCveFeeds() in short mode")
diff --git a/dbstore/sqlfs_test.go b/dbstore/sqlfs_test.go
new file mode 100644
index 0000000..c8cb345
--- /dev/null
+++ b/dbstore/sqlfs_test.go
@@ -0,0 +1,49 @@
+package dbstore
+
+import (
+ "testing"
+)
+
+func TestGetQuery(t *testing.T) {
+ tests := []struct {
+ name string
+ val string
+ exp bool
+ } {
+ { "pass", "init", true },
+ { "fail", "invalid", false },
+ }
+
+ for _, test := range(tests) {
+ t.Run(test.name, func(t *testing.T) {
+ got, err := getQuery(test.val)
+ if err != nil && test.exp {
+ t.Error(err)
+ } else if err == nil && !test.exp {
+ t.Errorf("got %v, exp error", got)
+ }
+ })
+ }
+}
+
+func TestGetQueries(t *testing.T) {
+ tests := []struct {
+ name string
+ vals []string
+ exp bool
+ } {
+ { "pass", []string { "init" }, true },
+ { "fail", []string { "invalid" }, false },
+ }
+
+ for _, test := range(tests) {
+ t.Run(test.name, func(t *testing.T) {
+ got, err := getQueries(test.vals)
+ if err != nil && test.exp {
+ t.Error(err)
+ } else if err == nil && !test.exp {
+ t.Errorf("got %v, exp error", got)
+ }
+ })
+ }
+}