op_test.go 390 B

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