github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/core/context_test.go (about)

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