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 88 "github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
99
1010 "github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
11+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
1112 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
1213)
1314
@@ -639,6 +640,39 @@ func TestList(t *testing.T) {
639640 },
640641 },
641642 },
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+ },
642676 } {
643677 t .Run (tt .name , func (t * testing.T ) {
644678 a := allocator .New ()
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ func (s *set) AddItem() *setItem {
2424 }
2525}
2626
27+ func (s * set ) AddItems (items ... value.Value ) * set {
28+ s .values = append (s .values , items ... )
29+
30+ return s
31+ }
32+
2733func (s * set ) Build () Builder {
2834 s .parent .params = append (s .parent .params , & Parameter {
2935 parent : s .parent ,
Original file line number Diff line number Diff line change 88 "github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
99
1010 "github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
11+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
1112 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
1213)
1314
@@ -816,6 +817,52 @@ func TestSet(t *testing.T) {
816817 },
817818 },
818819 },
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+ },
819866 } {
820867 t .Run (tt .name , func (t * testing.T ) {
821868 a := allocator .New ()
You can’t perform that action at this time.
0 commit comments