@@ -191,6 +191,11 @@ func TestRecordSchema(t *testing.T) {
191
191
schema : `{"type":"record", "name":"test", "namespace": "org.hamba.avro", "doc": "docs", "fields":[{"name": "field", "type": "int"}]}` ,
192
192
wantErr : require .NoError ,
193
193
},
194
+ {
195
+ name : "Empty Namespace" ,
196
+ schema : `{"type":"record", "name":"test", "namespace": "", "fields":[{"name": "intField", "type": "int"}]}` ,
197
+ wantErr : require .NoError ,
198
+ },
194
199
{
195
200
name : "Invalid Name First Char" ,
196
201
schema : `{"type":"record", "name":"0test", "namespace": "org.hamba.avro", "fields":[{"name": "field", "type": "int"}]}` ,
@@ -216,11 +221,6 @@ func TestRecordSchema(t *testing.T) {
216
221
schema : `{"type":"record", "name":"test", "namespace": "org.hamba.avro+", "fields":[{"name": "field", "type": "int"}]}` ,
217
222
wantErr : require .Error ,
218
223
},
219
- {
220
- name : "Empty Namespace" ,
221
- schema : `{"type":"record", "name":"test", "namespace": "", "fields":[{"name": "intField", "type": "int"}]}` ,
222
- wantErr : require .Error ,
223
- },
224
224
{
225
225
name : "No Fields" ,
226
226
schema : `{"type":"record", "name":"test", "namespace": "org.hamba.avro"}` ,
@@ -286,6 +286,11 @@ func TestErrorRecordSchema(t *testing.T) {
286
286
wantSchema : true ,
287
287
wantErr : require .NoError ,
288
288
},
289
+ {
290
+ name : "Empty Namespace" ,
291
+ schema : `{"type":"error", "name":"test", "namespace": "", "fields":[{"name": "intField", "type": "int"}]}` ,
292
+ wantErr : require .NoError ,
293
+ },
289
294
{
290
295
name : "Invalid Name First Char" ,
291
296
schema : `{"type":"error", "name":"0test", "namespace": "org.hamba.avro", "fields":[{"name": "field", "type": "int"}]}` ,
@@ -311,11 +316,6 @@ func TestErrorRecordSchema(t *testing.T) {
311
316
schema : `{"type":"error", "name":"test", "namespace": "org.hamba.avro+", "fields":[{"name": "field", "type": "int"}]}` ,
312
317
wantErr : require .Error ,
313
318
},
314
- {
315
- name : "Empty Namespace" ,
316
- schema : `{"type":"error", "name":"test", "namespace": "", "fields":[{"name": "intField", "type": "int"}]}` ,
317
- wantErr : require .Error ,
318
- },
319
319
}
320
320
321
321
for _ , test := range tests {
@@ -640,6 +640,11 @@ func TestEnumSchema(t *testing.T) {
640
640
wantDefault : "TEST" ,
641
641
wantErr : require .NoError ,
642
642
},
643
+ {
644
+ name : "Empty Namespace" ,
645
+ schema : `{"type":"enum", "name":"test", "namespace": "", "symbols":["TEST"]}` ,
646
+ wantErr : require .NoError ,
647
+ },
643
648
{
644
649
name : "Invalid Name" ,
645
650
schema : `{"type":"enum", "name":"test+", "namespace": "org.hamba.avro", "symbols":["TEST"]}` ,
@@ -660,11 +665,6 @@ func TestEnumSchema(t *testing.T) {
660
665
schema : `{"type":"enum", "name":"test", "namespace": "org.hamba.avro+", "symbols":["TEST"]}` ,
661
666
wantErr : require .Error ,
662
667
},
663
- {
664
- name : "Empty Namespace" ,
665
- schema : `{"type":"enum", "name":"test", "namespace": "", "symbols":["TEST"]}` ,
666
- wantErr : require .Error ,
667
- },
668
668
{
669
669
name : "No Symbols" ,
670
670
schema : `{"type":"enum", "name":"test", "namespace": "org.hamba.avro"}` ,
@@ -931,6 +931,11 @@ func TestFixedSchema(t *testing.T) {
931
931
wantFingerprint : [32 ]uint8 {0x8c , 0x9e , 0xcb , 0x4 , 0x83 , 0x2f , 0x3b , 0xa7 , 0x58 , 0x85 , 0x9 , 0x99 , 0x41 , 0xe , 0xbf , 0xd4 , 0x7 , 0xc7 , 0x87 , 0x4f , 0x8a , 0x12 , 0xf4 , 0xd0 , 0x7f , 0x45 , 0xdd , 0xaa , 0x10 , 0x6b , 0x2f , 0xb3 },
932
932
wantErr : require .NoError ,
933
933
},
934
+ {
935
+ name : "Empty Namespace" ,
936
+ schema : `{"type":"fixed", "name":"test", "namespace": "", "size": 12}` ,
937
+ wantErr : require .NoError ,
938
+ },
934
939
{
935
940
name : "Invalid Name" ,
936
941
schema : `{"type":"fixed", "name":"test+", "namespace": "org.hamba.avro", "size": 12}` ,
@@ -951,11 +956,6 @@ func TestFixedSchema(t *testing.T) {
951
956
schema : `{"type":"fixed", "name":"test", "namespace": "org.hamba.avro+", "size": 12}` ,
952
957
wantErr : require .Error ,
953
958
},
954
- {
955
- name : "Empty Namespace" ,
956
- schema : `{"type":"fixed", "name":"test", "namespace": "", "size": 12}` ,
957
- wantErr : require .Error ,
958
- },
959
959
{
960
960
name : "No Size" ,
961
961
schema : `{"type":"fixed", "name":"test", "namespace": "org.hamba.avro"}` ,
0 commit comments