goweb/middleware/debug/debug_test.go

23 lines
280 B
Go
Raw Permalink Normal View History

package debug
2018-12-06 15:18:05 +01:00
import (
"context"
"testing"
)
func TestContextDebug(t *testing.T) {
debug := false
ctx := context.WithValue(context.Background(), KeyDebug, debug)
dbg, err := From(ctx)
2018-12-06 15:18:05 +01:00
if err != nil {
t.Fatal(err)
}
if dbg {
t.Fatal("debug should be false")
}
}