summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/sirupsen/logrus/entry_test.go
diff options
context:
space:
mode:
authorLukas Macko <lmacko@cisco.com>2017-09-12 09:54:58 +0200
committerLukas Macko <lmacko@cisco.com>2017-09-12 10:49:11 +0200
commit217383b613248c79b542623ec6c571591de113ce (patch)
tree35b2064a8b780e0b18a8ffba31757caa2ed3e10f /vendor/github.com/sirupsen/logrus/entry_test.go
parentd07761baec9f09aef0b140ea46e38bd597dbdbbc (diff)
Use Sirupsen/logrus with uppercase
Change-Id: I2f8870c52f64eb56deb44e4a807867b3ef0a0b76 Signed-off-by: Lukas Macko <lmacko@cisco.com>
Diffstat (limited to 'vendor/github.com/sirupsen/logrus/entry_test.go')
-rw-r--r--vendor/github.com/sirupsen/logrus/entry_test.go77
1 files changed, 0 insertions, 77 deletions
diff --git a/vendor/github.com/sirupsen/logrus/entry_test.go b/vendor/github.com/sirupsen/logrus/entry_test.go
deleted file mode 100644
index 99c3b41..0000000
--- a/vendor/github.com/sirupsen/logrus/entry_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package logrus
-
-import (
- "bytes"
- "fmt"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestEntryWithError(t *testing.T) {
-
- assert := assert.New(t)
-
- defer func() {
- ErrorKey = "error"
- }()
-
- err := fmt.Errorf("kaboom at layer %d", 4711)
-
- assert.Equal(err, WithError(err).Data["error"])
-
- logger := New()
- logger.Out = &bytes.Buffer{}
- entry := NewEntry(logger)
-
- assert.Equal(err, entry.WithError(err).Data["error"])
-
- ErrorKey = "err"
-
- assert.Equal(err, entry.WithError(err).Data["err"])
-
-}
-
-func TestEntryPanicln(t *testing.T) {
- errBoom := fmt.Errorf("boom time")
-
- defer func() {
- p := recover()
- assert.NotNil(t, p)
-
- switch pVal := p.(type) {
- case *Entry:
- assert.Equal(t, "kaboom", pVal.Message)
- assert.Equal(t, errBoom, pVal.Data["err"])
- default:
- t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal)
- }
- }()
-
- logger := New()
- logger.Out = &bytes.Buffer{}
- entry := NewEntry(logger)
- entry.WithField("err", errBoom).Panicln("kaboom")
-}
-
-func TestEntryPanicf(t *testing.T) {
- errBoom := fmt.Errorf("boom again")
-
- defer func() {
- p := recover()
- assert.NotNil(t, p)
-
- switch pVal := p.(type) {
- case *Entry:
- assert.Equal(t, "kaboom true", pVal.Message)
- assert.Equal(t, errBoom, pVal.Data["err"])
- default:
- t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal)
- }
- }()
-
- logger := New()
- logger.Out = &bytes.Buffer{}
- entry := NewEntry(logger)
- entry.WithField("err", errBoom).Panicf("kaboom %v", true)
-}