Skip to content

Commit 6fe7e03

Browse files
committed
log: remove testify dependency
Testify was only used for a basic assertion. Remove the dependency, in preparation of (potentially) moving this package to a separate module. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent e2ad5a9 commit 6fe7e03

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

log/context_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ package log
1818

1919
import (
2020
"context"
21+
"reflect"
2122
"testing"
22-
23-
"github.com/stretchr/testify/assert"
2423
)
2524

2625
func TestLoggerContext(t *testing.T) {
26+
const expected = "one"
2727
ctx := context.Background()
28-
29-
ctx = WithLogger(ctx, G(ctx).WithField("test", "one"))
30-
assert.Equal(t, GetLogger(ctx).Data["test"], "one")
31-
assert.Same(t, G(ctx), GetLogger(ctx)) // these should be the same.
28+
ctx = WithLogger(ctx, G(ctx).WithField("test", expected))
29+
if actual := GetLogger(ctx).Data["test"]; actual != expected {
30+
t.Errorf("expected: %v, got: %v", expected, actual)
31+
}
32+
a := G(ctx)
33+
b := GetLogger(ctx)
34+
if !reflect.DeepEqual(a, b) || a != b {
35+
t.Errorf("should be the same: %+v, %+v", a, b)
36+
}
3237
}

0 commit comments

Comments
 (0)