1
0
mirror of https://github.com/DATA-DOG/go-sqlmock.git synced 2025-07-05 00:38:45 +02:00

fixes csv parse errors being silently ignored

This commit is contained in:
Ivo Gosemann
2023-05-04 19:19:09 +02:00
parent 44e746a20e
commit a1ad26d110
2 changed files with 15 additions and 2 deletions

View File

@ -461,6 +461,15 @@ func TestCSVRowParser(t *testing.T) {
}
}
func TestCSVParserInvalidInput(t *testing.T) {
defer func() {
recover()
}()
_ = NewRows([]string{"col1", "col2"}).FromCSVString("a,\"NULL\"\"")
// shouldn't reach here
t.Error("expected panic from parsing invalid CSV")
}
func TestWrongNumberOfValues(t *testing.T) {
// Open new mock database
db, mock, err := New()