github.com/xraypb/xray-core@v1.6.6/core/context_test.go (about) 1 package core_test 2 3 import ( 4 "context" 5 "testing" 6 _ "unsafe" 7 8 . "github.com/xraypb/xray-core/core" 9 ) 10 11 func TestFromContextPanic(t *testing.T) { 12 defer func() { 13 r := recover() 14 if r == nil { 15 t.Error("expect panic, but nil") 16 } 17 }() 18 19 MustFromContext(context.Background()) 20 }