github.com/v2pro/plz@v0.0.0-20221028024117-e5f9aec5b631/reflect2/test/op_test.go (about)

     1  package test
     2  
     3  import (
     4  	"github.com/v2pro/plz/reflect2"
     5  	"testing"
     6  	"github.com/v2pro/plz/countlog"
     7  	"github.com/v2pro/plz/test/must"
     8  	"github.com/v2pro/plz/test"
     9  )
    10  
    11  func testOp(f func(api reflect2.API) interface{}) func(t *testing.T) {
    12  	return test.Case(func(ctx *countlog.Context) {
    13  		unsafeResult := f(reflect2.ConfigUnsafe)
    14  		safeResult := f(reflect2.ConfigSafe)
    15  		must.Equal(safeResult, unsafeResult)
    16  	})
    17  }