mirror of
https://github.com/labstack/echo.git
synced 2025-04-19 12:12:51 +02:00
removing test logger as it actually doesnt help us at all
This commit is contained in:
parent
857fb3761d
commit
ad525c22a0
20
echo_test.go
20
echo_test.go
@ -1,7 +1,6 @@
|
|||||||
package echo
|
package echo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -42,25 +41,6 @@ func TestEcho(t *testing.T) {
|
|||||||
assert.Equal(t, http.StatusInternalServerError, rec.Code)
|
assert.Equal(t, http.StatusInternalServerError, rec.Code)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLogger(t *testing.T) {
|
|
||||||
prefix := "extremely-long-prefix-string-that-wont-exist"
|
|
||||||
logmsg := "test-log-message"
|
|
||||||
|
|
||||||
e := New()
|
|
||||||
|
|
||||||
var b bytes.Buffer
|
|
||||||
writer := bufio.NewWriter(&b)
|
|
||||||
|
|
||||||
e.logger.SetPrefix(prefix)
|
|
||||||
e.logger.SetOutput(writer)
|
|
||||||
e.logger.Print(logmsg)
|
|
||||||
|
|
||||||
output := b.String()
|
|
||||||
|
|
||||||
assert.Contains(t, prefix, output)
|
|
||||||
assert.Contains(t, logmsg, output)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEchoIndex(t *testing.T) {
|
func TestEchoIndex(t *testing.T) {
|
||||||
e := New()
|
e := New()
|
||||||
e.Index("_fixture/index.html")
|
e.Index("_fixture/index.html")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user