From 7368a48d124a1840dd34ebc7107e520c111fab6a Mon Sep 17 00:00:00 2001 From: GrowingRadish Date: Sun, 21 Jun 2020 13:39:04 +0200 Subject: [PATCH] Add test case for checking modification in guessDelimiter() (#804) --- tests/test-cases.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test-cases.js b/tests/test-cases.js index bc0b333..884832b 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -2538,7 +2538,15 @@ var CUSTOM_TESTS = [ var results = Papa.parse('"A","B","C","D"'); callback(results.meta.delimiter); } - } + }, + { + description: "Should correctly guess default delimiters when other sign is used more often but not right delimiter.", + expected: ";", + run: function(callback) { + var results = Papa.parse('ID;comment;geom\n1;HiThere;POLYGON(2 3, 3 4, 5 6, 4 5, 4 3, 2 3)\n2;HowAreYou;POLYGON(2 3, 3 4, 5 6, 4 5, 4 3, 2 3)\n3;WhatsUp;POLYGON(2 3, 3 4, 5 6, 4 5, 4 3, 2 3)\n4;Sunday;POLYGON(2 3, 3 4, 5 6, 4 5, 4 3, 2 3)'); + callback(results.meta.delimiter); + } + } ]; describe('Custom Tests', function() {