1
0
Fork 0

test for issue #2342

This commit is contained in:
jsteemann 2017-03-02 13:53:17 +01:00
parent 737698151d
commit 14d5898fc2
5 changed files with 29 additions and 0 deletions

View File

@ -3227,6 +3227,14 @@ const impTodos = [{
create: 'true',
separator: ';',
backslash: true
}, {
id: 'csvnoeol',
data: makePathUnix('js/common/test-data/import/import-noeol.csv'),
coll: 'UnitTestsImportCsvNoEol',
type: 'csv',
create: 'true',
separator: ',',
backslash: true
}, {
id: 'tsv1',
data: makePathUnix('js/common/test-data/import/import-1.tsv'),

View File

@ -0,0 +1,4 @@
"value1","value2"
a,b
c,d
e,f
1 value1 value2
2 a b
3 c d
4 e f

View File

@ -42,6 +42,7 @@
db._drop("UnitTestsImportCsv3");
db._drop("UnitTestsImportCsv4");
db._drop("UnitTestsImportCsv5");
db._drop("UnitTestsImportCsvNoEol");
db._drop("UnitTestsImportTsv1");
db._drop("UnitTestsImportTsv2");
db._drop("UnitTestsImportVertex");

View File

@ -42,6 +42,7 @@
db._drop("UnitTestsImportCsv3");
db._drop("UnitTestsImportCsv4");
db._drop("UnitTestsImportCsv5");
db._drop("UnitTestsImportCsvNoEol");
db._drop("UnitTestsImportTsv1");
db._drop("UnitTestsImportTsv2");
db._drop("UnitTestsImportVertex");

View File

@ -285,6 +285,21 @@ function importTestSuite () {
assertEqual(expected, actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test csv import without trailing eol
////////////////////////////////////////////////////////////////////////////////
testCsvImportNoEol : function () {
var expected = [
{ value1: "a", value2: "b" },
{ value1: "c", value2: "d" },
{ value1: "e", value2: "f" }
];
var actual = getQueryResults("FOR i IN UnitTestsImportCsvNoEol SORT i.value1 RETURN i");
assertEqual(expected, actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test tsv import
////////////////////////////////////////////////////////////////////////////////