File tree Expand file tree Collapse file tree 3 files changed +87
-0
lines changed Expand file tree Collapse file tree 3 files changed +87
-0
lines changed Original file line number Diff line number Diff line change 8
8
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
9
9
10
10
"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
11
+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
11
12
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
12
13
)
13
14
@@ -639,6 +640,39 @@ func TestList(t *testing.T) {
639
640
},
640
641
},
641
642
},
643
+ {
644
+ name : xtest .CurrentFileLine (),
645
+ builder : Builder {}.Param ("$x" ).List ().AddItems (value .Uint64Value (123 ), value .Uint64Value (321 )).Build (),
646
+ params : map [string ]* Ydb.TypedValue {
647
+ "$x" : {
648
+ Type : & Ydb.Type {
649
+ Type : & Ydb.Type_ListType {
650
+ ListType : & Ydb.ListType {
651
+ Item : & Ydb.Type {
652
+ Type : & Ydb.Type_TypeId {
653
+ TypeId : Ydb .Type_UINT64 ,
654
+ },
655
+ },
656
+ },
657
+ },
658
+ },
659
+ Value : & Ydb.Value {
660
+ Items : []* Ydb.Value {
661
+ {
662
+ Value : & Ydb.Value_Uint64Value {
663
+ Uint64Value : 123 ,
664
+ },
665
+ },
666
+ {
667
+ Value : & Ydb.Value_Uint64Value {
668
+ Uint64Value : 321 ,
669
+ },
670
+ },
671
+ },
672
+ },
673
+ },
674
+ },
675
+ },
642
676
} {
643
677
t .Run (tt .name , func (t * testing.T ) {
644
678
a := allocator .New ()
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ func (s *set) AddItem() *setItem {
24
24
}
25
25
}
26
26
27
+ func (s * set ) AddItems (items ... value.Value ) * set {
28
+ s .values = append (s .values , items ... )
29
+
30
+ return s
31
+ }
32
+
27
33
func (s * set ) Build () Builder {
28
34
s .parent .params = append (s .parent .params , & Parameter {
29
35
parent : s .parent ,
Original file line number Diff line number Diff line change 8
8
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
9
9
10
10
"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
11
+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
11
12
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
12
13
)
13
14
@@ -816,6 +817,52 @@ func TestSet(t *testing.T) {
816
817
},
817
818
},
818
819
},
820
+ {
821
+ name : xtest .CurrentFileLine (),
822
+ builder : Builder {}.Param ("$x" ).Set ().AddItems (value .Uint64Value (123 ), value .Uint64Value (321 )).Build (),
823
+ params : map [string ]* Ydb.TypedValue {
824
+ "$x" : {
825
+ Type : & Ydb.Type {
826
+ Type : & Ydb.Type_DictType {
827
+ DictType : & Ydb.DictType {
828
+ Key : & Ydb.Type {
829
+ Type : & Ydb.Type_TypeId {
830
+ TypeId : Ydb .Type_UINT64 ,
831
+ },
832
+ },
833
+ Payload : & Ydb.Type {
834
+ Type : & Ydb.Type_VoidType {},
835
+ },
836
+ },
837
+ },
838
+ },
839
+ Value : & Ydb.Value {
840
+ Pairs : []* Ydb.ValuePair {
841
+ {
842
+ Key : & Ydb.Value {
843
+ Value : & Ydb.Value_Uint64Value {
844
+ Uint64Value : 123 ,
845
+ },
846
+ },
847
+ Payload : & Ydb.Value {
848
+ Value : & Ydb.Value_NullFlagValue {},
849
+ },
850
+ },
851
+ {
852
+ Key : & Ydb.Value {
853
+ Value : & Ydb.Value_Uint64Value {
854
+ Uint64Value : 321 ,
855
+ },
856
+ },
857
+ Payload : & Ydb.Value {
858
+ Value : & Ydb.Value_NullFlagValue {},
859
+ },
860
+ },
861
+ },
862
+ },
863
+ },
864
+ },
865
+ },
819
866
} {
820
867
t .Run (tt .name , func (t * testing.T ) {
821
868
a := allocator .New ()
You can’t perform that action at this time.
0 commit comments