Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test to check for empty field in the begining #790

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/test-cases.js
Expand Up @@ -732,6 +732,23 @@ var PARSE_TESTS = [
}]
}
},
{
description: "Row with enough fields but blank field in the begining",
input: 'A,B,C\r\n,b1,c1\r\na2,b2,c2',
expected: {
data: [["A", "B", "C"], ['', 'b1', 'c1'], ['a2', 'b2', 'c2']],
errors: []
}
},
{
description: "Row with enough fields but blank field in the begining using headers",
input: 'A,B,C\r\n,b1,c1\r\n,b2,c2',
config: { header: true },
expected: {
data: [{"A": "", "B": "b1", "C": "c1"}, {"A": "", "B": "b2", "C": "c2"}],
errors: []
}
},
{
description: "Row with enough fields but blank field at end",
input: 'A,B,C\r\na,b,',
Expand Down