goweb/middleware/debug_test.go

23 lines
289 B
Go
Raw Normal View History

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