From 0b3f29c3535e28519d58d04e8b8092e499abdd23 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 7 Jun 2018 13:51:47 +0200 Subject: [PATCH] Remove non needed test cases --- tests/test-cases.js | 61 ++++++++++++--------------------------------- 1 file changed, 16 insertions(+), 45 deletions(-) diff --git a/tests/test-cases.js b/tests/test-cases.js index bf4b11d..b7f55ef 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -340,35 +340,6 @@ var CORE_PARSER_TESTS = [ data: [['a', 'b', 'c'], ['', 'e', 'f'], ['', 'h', 'i'], ['', 'k', 'l']], errors: [] } - }, - { - description: "Line ends with quoted field, first field of next line is empty, \\r\\n", - input: 'a,b,c\r\n,e,f\r\n,"h","i"\r\n,"k","l"', - config: { - newline: '\r\n', - }, - expected: { - data: [['a', 'b', 'c'], ['', 'e', 'f'], ['', 'h', 'i'], ['', 'k', 'l']], - errors: [] - } - }, - { - description: "Line ends with quoted field (longer), \\r\\n", - input: 'Task_TaskID,Task_Description,Task_BudgetHours,Task_Reference,Project_ProjectCode,Project_Description,Customer_CustomerCode,Customer_Name\r\n,"",,"","","","ABCDE","ABCDE Consulting"\r\n,"",,"","","","FGHIJ","FGHIJ Limited (Pty)"\r\n,"",,"","","","KLUMN","KLUMN"\r\n,"",,"","","","OPQRS","OPQRS Ltd"\r\n,"",,"","","","TUVWX","TUVWX Pty Ltd"', - config: { - newline: '\r\n', - }, - expected: { - data: [ - ['Task_TaskID','Task_Description','Task_BudgetHours','Task_Reference','Project_ProjectCode','Project_Description','Customer_CustomerCode','Customer_Name'], - ['','','','','','','ABCDE','ABCDE Consulting'], - ['','','','','','','FGHIJ','FGHIJ Limited (Pty)'], - ['','','','','','','KLUMN','KLUMN'], - ['','','','','','','OPQRS','OPQRS Ltd'], - ['','','','','','','TUVWX','TUVWX Pty Ltd'], - ], - errors: [] - } }, { description: "Quoted field at end of row (but not at EOF) has quotes", @@ -690,22 +661,6 @@ var PARSE_TESTS = [ errors: [] } }, - { - description: "Line ends with quoted field, first field of next line is empty \\r\\n", - input: 'a,b,"c"\r\nd,e,"f"\r\n,"h","i"\r\n,"k","l"', - config: { - header: true, - newline: '\r\n', - }, - expected: { - data: [ - {a: 'd', b: 'e', c: 'f'}, - {a: '', b: 'h', c: 'i'}, - {a: '', b: 'k', c: 'l'} - ], - errors: [] - } - }, { description: "Mixed slash n and slash r should choose first as precident", input: 'a,b,c\nd,e,f\rg,h,i\n', @@ -778,6 +733,22 @@ var PARSE_TESTS = [ errors: [] } }, + { + description: "Line ends with quoted field, first field of next line is empty using headers", + input: 'a,b,"c"\r\nd,e,"f"\r\n,"h","i"\r\n,"k","l"', + config: { + header: true, + newline: '\r\n', + }, + expected: { + data: [ + {a: 'd', b: 'e', c: 'f'}, + {a: '', b: 'h', c: 'i'}, + {a: '', b: 'k', c: 'l'} + ], + errors: [] + } + }, { description: "Tab delimiter", input: 'a\tb\tc\r\nd\te\tf',