Skip to content

Commit

Permalink
refactor: move util package tests to dedicated package
Browse files Browse the repository at this point in the history
Allow helpertest to use util since only the tests need helpertests, we
can use util from there without creating a circular dependency.
  • Loading branch information
ThinkChaos committed Aug 30, 2024
1 parent 380906d commit 9da89c3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion util/arpa_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package util
package util_test

import (
"net"

. "github.com/0xERR0R/blocky/util"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
Expand Down
3 changes: 2 additions & 1 deletion util/common_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package util_test

import (
"context"
Expand All @@ -12,6 +12,7 @@ import (
"github.com/sirupsen/logrus/hooks/test"

. "github.com/0xERR0R/blocky/log"
. "github.com/0xERR0R/blocky/util"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
Expand Down
3 changes: 2 additions & 1 deletion util/context_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package util
package util_test

import (
"context"
"time"

. "github.com/0xERR0R/blocky/util"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
Expand Down
3 changes: 2 additions & 1 deletion util/edns0_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package util
package util_test

import (
"net"

. "github.com/0xERR0R/blocky/helpertest"
. "github.com/0xERR0R/blocky/util"
"github.com/miekg/dns"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
3 changes: 2 additions & 1 deletion util/http_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package util_test

import (
"context"
Expand All @@ -7,6 +7,7 @@ import (
"net/url"
"reflect"

. "github.com/0xERR0R/blocky/util"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
. "github.com/onsi/ginkgo/v2"
Expand Down
3 changes: 2 additions & 1 deletion util/tls_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package util
package util_test

import (
"crypto/x509"

. "github.com/0xERR0R/blocky/util"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
Expand Down
2 changes: 1 addition & 1 deletion util/util_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package util_test

import (
"testing"
Expand Down

0 comments on commit 9da89c3

Please sign in to comment.