11package scalar
22
33import (
4+ "net"
45 "testing"
56
67 "github.com/apache/arrow/go/v14/arrow"
8+ "github.com/cloudquery/plugin-sdk/v4/types"
79)
810
911func TestListSet (t * testing.T ) {
12+ ipOne := net.IP {192 , 168 , 1 , 1 }
13+ ipNet := net.IPNet {IP : ipOne , Mask : net.IPMask {255 , 255 , 255 , 255 }}
14+ typedNil := (* net .IP )(nil )
1015 successfulTests := []struct {
1116 source any
1217 result List
@@ -23,6 +28,15 @@ func TestListSet(t *testing.T) {
2328 & Int {Value : 1 , Valid : true },
2429 & Int {Value : 2 , Valid : true },
2530 }, Valid : true , Type : arrow .ListOf (arrow .PrimitiveTypes .Int64 )}},
31+ {source : []* net.IPNet {& ipNet , nil }, result : List {Value : []Scalar {
32+ & Inet {Value : & ipNet , Valid : true },
33+ & Inet {Valid : false },
34+ }, Valid : true , Type : arrow .ListOf (types .ExtensionTypes .Inet )}},
35+ {source : []* net.IP {& ipOne , typedNil , nil }, result : List {Value : []Scalar {
36+ & Inet {Value : & ipNet , Valid : true },
37+ & Inet {Valid : false },
38+ & Inet {Valid : false },
39+ }, Valid : true , Type : arrow .ListOf (types .ExtensionTypes .Inet )}},
2640 }
2741
2842 for i , tt := range successfulTests {
0 commit comments