From 024da3e546e98cbaeea5f7bc86af12b671996f41 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Thu, 29 Jun 2023 23:05:23 +0200 Subject: 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. --- pkg/testkit/testkit.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/testkit/testkit.go') 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) } -- cgit v1.2.3