Cleanup after migration
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
@@ -5,15 +5,14 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gotestyourself/gotestyourself/assert"
|
||||
is "github.com/gotestyourself/gotestyourself/assert/cmp"
|
||||
)
|
||||
|
||||
func TestLoggerContext(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
assert.Check(t, is.DeepEqual(GetLogger(ctx), L)) // should be same as L variable
|
||||
assert.Check(t, is.DeepEqual(G(ctx), GetLogger(ctx))) // these should be the same.
|
||||
assert.Equal(t, GetLogger(ctx), L) // should be same as L variable
|
||||
assert.Equal(t, G(ctx), GetLogger(ctx)) // these should be the same.
|
||||
|
||||
ctx = WithLogger(ctx, G(ctx).WithField("test", "one"))
|
||||
assert.Check(t, is.DeepEqual(GetLogger(ctx).Data["test"], "one"))
|
||||
assert.Check(t, is.DeepEqual(G(ctx), GetLogger(ctx))) // these should be the same.
|
||||
assert.Equal(t, GetLogger(ctx).Data["test"], "one")
|
||||
assert.Equal(t, G(ctx), GetLogger(ctx)) // these should be the same.
|
||||
}
|
||||
|
Reference in New Issue
Block a user