github.com/EagleQL/Xray-core@v1.4.3/core/context_test.go (about)

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