mirror of https://github.com/VinGarcia/ksql.git
Add one final test for the logger feature
parent
08247e5b82
commit
5513a0c68d
|
@ -0,0 +1,19 @@
|
||||||
|
package ksql
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
tt "github.com/vingarcia/ksql/internal/testtools"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCtxLog(t *testing.T) {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
t.Run("should not log anything nor panic if logger is nil", func(t *testing.T) {
|
||||||
|
panicPayload := tt.PanicHandler(func() {
|
||||||
|
ctxLog(ctx, "fakeQuery", []interface{}{}, nil)
|
||||||
|
})
|
||||||
|
tt.AssertEqual(t, panicPayload, nil)
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in New Issue