Cleanup after migration

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2018-01-18 16:49:34 -05:00
parent ef48a0268e
commit 37aa41b164
5 changed files with 13 additions and 19 deletions

View File

@@ -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.
}