github.com/xraypb/Xray-core@v1.8.1/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 }