@@ -2,7 +2,7 @@ package frame
22
33import (
44 "math"
5- "net"
5+ "net/netip "
66 "testing"
77
88 "github.com/google/go-cmp/cmp"
@@ -509,7 +509,7 @@ func TestCqlValueAsIP(t *testing.T) {
509509 name string
510510 content CqlValue
511511 valid bool
512- expected net. IP
512+ expected netip. Addr
513513 }{
514514 {
515515 name : "wrong length" ,
@@ -530,19 +530,19 @@ func TestCqlValueAsIP(t *testing.T) {
530530 name : "valid v4" ,
531531 content : CqlValue {
532532 Type : & Option {ID : InetID },
533- Value : Bytes (net. IP {127 , 0 , 0 , 1 }) ,
533+ Value : Bytes {127 , 0 , 0 , 1 },
534534 },
535535 valid : true ,
536- expected : net. IP {127 , 0 , 0 , 1 },
536+ expected : netip . AddrFrom4 ([ 4 ] byte {127 , 0 , 0 , 1 }) ,
537537 },
538538 {
539539 name : "valid v6" ,
540540 content : CqlValue {
541541 Type : & Option {ID : InetID },
542- Value : Bytes (net. IP { 127 , 0 , 0 , 1 }. To16 ()) ,
542+ Value : [] byte { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 255 , 255 , 127 , 0 , 0 , 1 },
543543 },
544544 valid : true ,
545- expected : net. IP { 127 , 0 , 0 , 1 }. To16 ( ),
545+ expected : netip . AddrFrom16 ([ 16 ] byte { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 255 , 255 , 127 , 0 , 0 , 1 }),
546546 },
547547 }
548548
@@ -557,8 +557,8 @@ func TestCqlValueAsIP(t *testing.T) {
557557 }
558558 return
559559 }
560- if diff := cmp . Diff ( v , tc .expected ); diff != "" {
561- t .Fatalf (diff )
560+ if v != tc .expected {
561+ t .Fatalf ("expected %v, got %v" , tc . expected , v )
562562 }
563563 })
564564 }
0 commit comments