Skip to content

Commit 4c3e8ee

Browse files
author
Stefan Tudose
committed
add more tests for ErrScanTargetsNotMatch
1 parent ed0442b commit 4c3e8ee

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

parser_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ func TestParserIgnoreUnmatchingFields(t *testing.T) {
7979
scanTargets: []interface{}{&strVal},
8080
expectedError: ErrScanTargetsNotMatch,
8181
},
82+
{
83+
name: "should fail with more targets with the default config",
84+
config: ParserConfig{},
85+
data: "rec,2\n",
86+
scanTargets: []interface{}{&strVal, &intVal, &anotherIntVal},
87+
expectedError: ErrScanTargetsNotMatch,
88+
},
89+
{
90+
name: "should fail with more records with the default config",
91+
config: ParserConfig{},
92+
data: "rec,2\n",
93+
scanTargets: []interface{}{&strVal},
94+
expectedError: ErrScanTargetsNotMatch,
95+
},
8296
} {
8397
tc := tc
8498
t.Run(tc.name, func(t *testing.T) {

0 commit comments

Comments
 (0)