context_test.go 280 B

1234567891011121314151617181920
  1. package core_test
  2. import (
  3. "context"
  4. "testing"
  5. _ "unsafe"
  6. . "github.com/v2fly/v2ray-core/v5"
  7. )
  8. func TestFromContextPanic(t *testing.T) {
  9. defer func() {
  10. r := recover()
  11. if r == nil {
  12. t.Error("expect panic, but nil")
  13. }
  14. }()
  15. MustFromContext(context.Background())
  16. }