chore: inline log.Interface and handle empty and nil slices the same

This commit is contained in:
2022-06-17 09:53:03 +02:00
parent 18d12ed1b4
commit d5e322ca9e
2 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ func TestMock_Check(t *testing.T) {
name: "different",
fields: fields{Logged: []string{"same"}},
args: args{wantLogged: []string{"different"}},
want: []string{"\n\tError Trace:\tmocks.go:63\n\t \t\t\t\tmocks_test.go:63\n\tError: \tNot equal: \n\t \texpected: []string{\"different\"}\n\t \tactual : []string{\"same\"}\n\t \t\n\t \tDiff:\n\t \t--- Expected\n\t \t+++ Actual\n\t \t@@ -1,3 +1,3 @@\n\t \t ([]string) (len=1) {\n\t \t- (string) (len=9) \"different\"\n\t \t+ (string) (len=4) \"same\"\n\t \t }\n\tTest: \t\n"},
want: []string{"\n\tError Trace:\tmocks.go:67\n\t \t\t\t\tmocks_test.go:63\n\tError: \tNot equal: \n\t \texpected: []string{\"different\"}\n\t \tactual : []string{\"same\"}\n\t \t\n\t \tDiff:\n\t \t--- Expected\n\t \t+++ Actual\n\t \t@@ -1,3 +1,3 @@\n\t \t ([]string) (len=1) {\n\t \t- (string) (len=9) \"different\"\n\t \t+ (string) (len=4) \"same\"\n\t \t }\n\tTest: \t\n"},
},
}
for _, tt := range tests {
@@ -68,7 +68,7 @@ func TestMock_Check(t *testing.T) {
func TestNew(t *testing.T) {
logger := New()
logger.Logger.Info("logging")
logger.Info("logging")
logger.Check(t, []string{"info: logging"})
}