github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/context_test.go (about)

     1  package core_test
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  	_ "unsafe"
     7  
     8  	. "github.com/v2fly/v2ray-core/v5"
     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  }