File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 6
6
"reflect"
7
7
"testing"
8
8
"time"
9
+ "unsafe"
9
10
10
11
"github.com/go-test/deep"
11
12
v1 "github.com/go-test/deep/test/v1"
@@ -313,8 +314,12 @@ func TestMaxDiff(t *testing.T) {
313
314
func TestNotHandled (t * testing.T ) {
314
315
// UnsafePointer is pretty much the only kind not handled now
315
316
v := []int {1 }
316
- a := reflect .ValueOf (v ).UnsafePointer ()
317
- b := reflect .ValueOf (v ).UnsafePointer ()
317
+ a := unsafe .Pointer (& v )
318
+ b := unsafe .Pointer (& v )
319
+ // UnsafePointer added in Go 1.88. Use these lines once this pkg
320
+ // no longer supports Go 1.17.
321
+ //a := reflect.ValueOf(v).UnsafePointer()
322
+ //b := reflect.ValueOf(v).UnsafePointer()
318
323
diff := deep .Equal (a , b )
319
324
if len (diff ) > 0 {
320
325
t .Error ("got diffs:" , diff )
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ go test -coverprofile=coverage.out " $@ "
3
+ go tool cover -html=coverage.out
You can’t perform that action at this time.
0 commit comments