goweb/middleware/debug/debug_test.go
William Petit 38f4c7b735 Move Debug and ServiceContainer middlewares into their own packages
- Implements From/Must accessors to facilitate context values retrieval
2018-12-07 10:13:53 +01:00

23 lines
280 B
Go

package debug
import (
"context"
"testing"
)
func TestContextDebug(t *testing.T) {
debug := false
ctx := context.WithValue(context.Background(), KeyDebug, debug)
dbg, err := From(ctx)
if err != nil {
t.Fatal(err)
}
if dbg {
t.Fatal("debug should be false")
}
}