|
@ -30,10 +30,10 @@ func TestStructToSchema(t *testing.T) { |
|
|
Field2 string |
|
|
Field2 string |
|
|
}{}, |
|
|
}{}, |
|
|
}, |
|
|
}, |
|
|
want: NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
want: RecordTypeBegin(). |
|
|
SetField("Field1", TypeInteger). |
|
|
SetField("Field1", TypeInteger). |
|
|
SetField("Field2", TypeString). |
|
|
SetField("Field2", TypeString). |
|
|
Build(), |
|
|
|
|
|
|
|
|
RecordTypeEnd(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "simple list", |
|
|
name: "simple list", |
|
@ -43,10 +43,10 @@ func TestStructToSchema(t *testing.T) { |
|
|
Field2 string |
|
|
Field2 string |
|
|
}{}, |
|
|
}{}, |
|
|
}, |
|
|
}, |
|
|
want: NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
want: RecordTypeBegin(). |
|
|
SetField("Field1", ListOf(TypeInteger)). |
|
|
SetField("Field1", ListOf(TypeInteger)). |
|
|
SetField("Field2", TypeString). |
|
|
SetField("Field2", TypeString). |
|
|
Build(), |
|
|
|
|
|
|
|
|
RecordTypeEnd(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "simple []byte", |
|
|
name: "simple []byte", |
|
@ -55,9 +55,9 @@ func TestStructToSchema(t *testing.T) { |
|
|
Field2 []byte |
|
|
Field2 []byte |
|
|
}{}, |
|
|
}{}, |
|
|
}, |
|
|
}, |
|
|
want: NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
want: RecordTypeBegin(). |
|
|
SetField("Field2", TypeBytes). |
|
|
SetField("Field2", TypeBytes). |
|
|
Build(), |
|
|
|
|
|
|
|
|
RecordTypeEnd(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "nested simpe structs", |
|
|
name: "nested simpe structs", |
|
@ -70,13 +70,15 @@ func TestStructToSchema(t *testing.T) { |
|
|
} |
|
|
} |
|
|
}{}, |
|
|
}{}, |
|
|
}, |
|
|
}, |
|
|
want: NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
want: RecordTypeBegin(). |
|
|
SetField("Field1", TypeInteger). |
|
|
SetField("Field1", TypeInteger). |
|
|
SetRecordField("Field2", NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
SetRecordField("Field2", |
|
|
|
|
|
RecordTypeBegin(). |
|
|
SetField("Field3", TypeString). |
|
|
SetField("Field3", TypeString). |
|
|
SetField("Field4", TypeInteger), |
|
|
|
|
|
|
|
|
SetField("Field4", TypeInteger). |
|
|
|
|
|
RecordTypeEnd(), |
|
|
). |
|
|
). |
|
|
Build(), |
|
|
|
|
|
|
|
|
RecordTypeEnd(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "nested struct type", |
|
|
name: "nested struct type", |
|
@ -93,17 +95,19 @@ func TestStructToSchema(t *testing.T) { |
|
|
} |
|
|
} |
|
|
}{}, |
|
|
}{}, |
|
|
}, |
|
|
}, |
|
|
want: NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
want: RecordTypeBegin(). |
|
|
SetField("Field1", TypeInteger). |
|
|
SetField("Field1", TypeInteger). |
|
|
SetRecordField("Field2", NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
SetRecordField("Field2", RecordTypeBegin(). |
|
|
SetField("Field3", TypeString). |
|
|
SetField("Field3", TypeString). |
|
|
SetField("Field4", ListOf(TypeInteger)). |
|
|
SetField("Field4", ListOf(TypeInteger)). |
|
|
SetRecordField("Field5", NewRecordTypeBuilder(). |
|
|
|
|
|
|
|
|
SetRecordField("Field5", |
|
|
|
|
|
RecordTypeBegin(). |
|
|
SetField("Field6", TypeString). |
|
|
SetField("Field6", TypeString). |
|
|
SetField("Field7", TypeBytes), |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
SetField("Field7", TypeBytes). |
|
|
|
|
|
RecordTypeEnd(), |
|
|
|
|
|
).RecordTypeEnd(), |
|
|
). |
|
|
). |
|
|
Build(), |
|
|
|
|
|
|
|
|
RecordTypeEnd(), |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|