Skip to content

Commit

Permalink
fix: backslash type (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjoDiaz authored and knownasilya committed Mar 25, 2019
1 parent 29bbad1 commit 389891a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ module.exports = (testRunner, jsonFixtures, csvFixtures) => {
});
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end', (t) => {
child_process.exec(cli + '-i ' + getFixturePath('/json/backslashAtEnd.json'), (err, stdout, stderr) => {
t.notOk(stderr);
const csv = stdout;
Expand All @@ -449,7 +449,7 @@ module.exports = (testRunner, jsonFixtures, csvFixtures) => {
});
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end, and its not the last column', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end, and its not the last column', (t) => {
child_process.exec(cli + '-i ' + getFixturePath('/json/backslashAtEndInMiddleColumn.json'), (err, stdout, stderr) => {
t.notOk(stderr);
const csv = stdout;
Expand Down
4 changes: 2 additions & 2 deletions test/JSON2CSVAsyncParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,15 @@ module.exports = (testRunner, jsonFixtures, csvFixtures, inMemoryJsonFixtures) =
.then(() => t.end());
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end', (t) => {
const parser = new AsyncParser();
parser.fromInput(jsonFixtures.backslashAtEnd()).promise()
.then(csv => t.equal(csv, csvFixtures.backslashAtEnd))
.catch(err => t.notOk(true, err.message))
.then(() => t.end());
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end, and its not the last column', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end, and its not the last column', (t) => {
const parser = new AsyncParser();
parser.fromInput(jsonFixtures.backslashAtEndInMiddleColumn()).promise()
.then(csv => t.equal(csv, csvFixtures.backslashAtEndInMiddleColumn))
Expand Down
4 changes: 2 additions & 2 deletions test/JSON2CSVParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,15 @@ module.exports = (testRunner, jsonFixtures, csvFixtures) => {
t.end();
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end', (t) => {
const parser = new Json2csvParser();
const csv = parser.parse(jsonFixtures.backslashAtEnd);

t.equal(csv, csvFixtures.backslashAtEnd);
t.end();
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end, and its not the last column', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end, and its not the last column', (t) => {
const parser = new Json2csvParser();
const csv = parser.parse(jsonFixtures.backslashAtEndInMiddleColumn);

Expand Down
4 changes: 2 additions & 2 deletions test/JSON2CSVTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ module.exports = (testRunner, jsonFixtures, csvFixtures, inMemoryJsonFixtures) =
});
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end', (t) => {
const transform = new Json2csvTransform();
const processor = jsonFixtures.backslashAtEnd().pipe(transform);

Expand All @@ -855,7 +855,7 @@ module.exports = (testRunner, jsonFixtures, csvFixtures, inMemoryJsonFixtures) =
});
});

testRunner.add('should not escape quotes with double quotes, when there is a backslah in the end, and its not the last column', (t) => {
testRunner.add('should not escape quotes with double quotes, when there is a backslash in the end, and its not the last column', (t) => {
const transform = new Json2csvTransform();
const processor = jsonFixtures.backslashAtEndInMiddleColumn().pipe(transform);

Expand Down

0 comments on commit 389891a

Please sign in to comment.