aboutsummaryrefslogtreecommitdiff
path: root/pkg/testkit/testkit.go
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-29 23:05:23 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-29 23:06:44 +0200
commit024da3e546e98cbaeea5f7bc86af12b671996f41 (patch)
tree08b38491b7e726fb448cceaceb2ef536360b2223 /pkg/testkit/testkit.go
parent9ba53fea71728ce64342d0d59f4199876e4b6164 (diff)
downloadlens-024da3e546e98cbaeea5f7bc86af12b671996f41.tar.gz
lens-024da3e546e98cbaeea5f7bc86af12b671996f41.tar.bz2
lens-024da3e546e98cbaeea5f7bc86af12b671996f41.zip
ref: Refactor how repository is define
To make things easier and reduce the number of package I'll move all repository to one folder, starting with auth and user repository. Also implements all testing on top of the repository interface with a im memory implementation. This will later make mescling unit and integration easier.
Diffstat (limited to 'pkg/testkit/testkit.go')
-rw-r--r--pkg/testkit/testkit.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/testkit/testkit.go b/pkg/testkit/testkit.go
index 526e1b3..3cc4afd 100644
--- a/pkg/testkit/testkit.go
+++ b/pkg/testkit/testkit.go
@@ -9,18 +9,21 @@ import (
)
func TestValue[T any](t *testing.T, method string, want, got T) {
+ t.Helper()
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("%s() mismatch (-want +got):\n%s", method, diff)
}
}
func TestFatalError(t *testing.T, method string, err error) {
+ t.Helper()
if err != nil {
t.Fatalf("%s() fatal error : %+v", method, err)
}
}
func TestError(t *testing.T, method string, want, got error) {
+ t.Helper()
if !equalError(want, got) {
t.Errorf("%s() err mismatch want: %+v got %+v", method, want, got)
}