@@ -627,10 +627,64 @@ func TestHeader(t *testing.T) {
627627 err : & UnsupportedTypeError {Type : reflect .TypeOf (int (0 ))},
628628 },
629629 {
630- desc : "slice" ,
631- v : []TypeJ {{}},
630+ desc : "slice" ,
631+ v : []TypeJ {{}},
632+ tag : "csv" ,
633+ header : []string {"STR" , "int" , "Bool" , "Uint8" , "float" },
634+ },
635+ {
636+ desc : "ptr slice" ,
637+ v : & []TypeJ {{}},
638+ tag : "csv" ,
639+ header : []string {"STR" , "int" , "Bool" , "Uint8" , "float" },
640+ },
641+ {
642+ desc : "slice with ptr value" ,
643+ v : []* TypeJ {{}},
644+ tag : "csv" ,
645+ header : []string {"STR" , "int" , "Bool" , "Uint8" , "float" },
646+ },
647+ {
648+ desc : "slice with non-struct" ,
649+ v : []int {0 },
650+ tag : "csv" ,
651+ err : & UnsupportedTypeError {Type : reflect .TypeOf ([]int {0 })},
652+ },
653+ {
654+ desc : "two-dimensional slice" ,
655+ v : [][]TypeJ {{{}}},
656+ tag : "csv" ,
657+ err : & UnsupportedTypeError {Type : reflect .TypeOf ([][]TypeJ {{}})},
658+ },
659+ {
660+ desc : "array" ,
661+ v : [1 ]TypeJ {{}},
662+ tag : "csv" ,
663+ header : []string {"STR" , "int" , "Bool" , "Uint8" , "float" },
664+ },
665+ {
666+ desc : "ptr array" ,
667+ v : & [1 ]TypeJ {{}},
668+ tag : "csv" ,
669+ header : []string {"STR" , "int" , "Bool" , "Uint8" , "float" },
670+ },
671+ {
672+ desc : "array with ptr value" ,
673+ v : [1 ]* TypeJ {{}},
674+ tag : "csv" ,
675+ header : []string {"STR" , "int" , "Bool" , "Uint8" , "float" },
676+ },
677+ {
678+ desc : "array with non-struct" ,
679+ v : [1 ]int {0 },
680+ tag : "csv" ,
681+ err : & UnsupportedTypeError {Type : reflect .TypeOf ([1 ]int {0 })},
682+ },
683+ {
684+ desc : "two-dimensional array" ,
685+ v : [1 ][1 ]TypeJ {{{}}},
632686 tag : "csv" ,
633- err : & UnsupportedTypeError {Type : reflect .TypeOf ([] TypeJ {})},
687+ err : & UnsupportedTypeError {Type : reflect .TypeOf ([1 ][ 1 ] TypeJ {{} })},
634688 },
635689 {
636690 desc : "nil interface" ,
0 commit comments