| 1 | package logrus_testscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.13 testing/" |
| 5 | |
| 6 | logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/ "github.com/sirupsen/logrusscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/" |
| 7 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/assert`/" |
| 8 | ) |
| 9 | |
| 10 | func TestLogger_LogFnscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus_test`/TestLogger_LogFn().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 11 | logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/.SetFormatterscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/SetFormatter().(&logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/.JSONFormatterscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/JSONFormatter#{}) |
| 12 | logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/.SetLevelscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/SetLevel().(logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/.WarnLevelscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/WarnLevel.) |
| 13 | |
| 14 | notCalled := 0 |
| 15 | logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/.InfoFnscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/InfoFn().(func() []interface{} { |
| 16 | notCalled++ |
| 17 | return []interface{}{ |
| 18 | "Hello", |
| 19 | } |
| 20 | }) |
| 21 | assertscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/assert`/Equal().(t, 0, notCalled) |
| 22 | |
| 23 | called := 0 |
| 24 | logscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/.ErrorFnscip-go gomod github.com/sirupsen/logrus . `github.com/sirupsen/logrus`/ErrorFn().(func() []interface{} { |
| 25 | called++ |
| 26 | return []interface{}{ |
| 27 | "Oopsi", |
| 28 | } |
| 29 | }) |
| 30 | assertscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/assert`/Equal().(t, 1, called) |
| 31 | } |