context_test.go 264 B

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