(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestDebug(t *testing.T) { |
| 47 | var bufDebug bytes.Buffer |
| 48 | |
| 49 | ld := log.NewTMLogger(&bufDebug) |
| 50 | ld.Debug("Client initialized with old header (trusted is more recent)", |
| 51 | "old", 42, |
| 52 | "trustedHeight", "forty two", |
| 53 | "trustedHash", []byte("test me")) |
| 54 | |
| 55 | msg := strings.TrimSpace(bufDebug.String()) |
| 56 | |
| 57 | // Remove the timestamp information to allow |
| 58 | // us to test against the expected message. |
| 59 | receivedmsg := strings.Split(msg, "] ")[1] |
| 60 | |
| 61 | const expectedmsg = `Client initialized with old header |
| 62 | (trusted is more recent) old=42 trustedHeight="forty two" |
| 63 | trustedHash=74657374206D65` |
| 64 | if strings.EqualFold(receivedmsg, expectedmsg) { |
| 65 | t.Fatalf("received %s, expected %s", receivedmsg, expectedmsg) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func TestError(t *testing.T) { |
| 70 | var bufErr bytes.Buffer |
nothing calls this directly
no test coverage detected