From a922415819132fd112ad7ea3cf143f50a8c80546 Mon Sep 17 00:00:00 2001 From: Damir Khakimov <damir.hakimov@gmail.com> Date: Tue, 19 Nov 2019 10:55:18 +0400 Subject: [PATCH 1/2] Test case for issue 738: Skip lines future. https://github.com/mholt/PapaParse/issues/738 --- tests/test-cases.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test-cases.js b/tests/test-cases.js index bc8e2f7..9919dd9 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -534,6 +534,27 @@ var CORE_PARSER_TESTS = [ errors: [] } }, + { + description: "Skipped line at beginning", + input: 'Skipped_line\na,b,c', + config: { skipLines: 1 }, + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, + { + description: "Skipped line at beginning followed by comment line", + input: 'Skipped_line\n# Comment\na,b,c', + config: { + skipLines: 1, + comments: true + }, + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, { description: "Multiple rows, one column (no delimiter found)", input: 'a\nb\nc\nd\ne', From 0dc117231e2250deb5e9254fd920149ff43f6829 Mon Sep 17 00:00:00 2001 From: Damir Khakimov <damir.hakimov@gmail.com> Date: Thu, 21 Nov 2019 10:27:13 +0400 Subject: [PATCH 2/2] Fix Expected indentation error --- tests/test-cases.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test-cases.js b/tests/test-cases.js index 9919dd9..fcbc3c4 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -534,7 +534,7 @@ var CORE_PARSER_TESTS = [ errors: [] } }, - { + { description: "Skipped line at beginning", input: 'Skipped_line\na,b,c', config: { skipLines: 1 }, @@ -543,13 +543,13 @@ var CORE_PARSER_TESTS = [ errors: [] } }, - { - description: "Skipped line at beginning followed by comment line", + { + description: "Skipped line at beginning followed by comment line", input: 'Skipped_line\n# Comment\na,b,c', config: { - skipLines: 1, - comments: true - }, + skipLines: 1, + comments: true + }, expected: { data: [['a', 'b', 'c']], errors: []