Skip to content

Commit

Permalink
0001159: PostgresBulkDatabaseWriter using the wrong escape character …
Browse files Browse the repository at this point in the history
…for bulk CSV
  • Loading branch information
chenson42 committed Apr 4, 2013
1 parent 8537527 commit 4c5feb4
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -22,6 +22,7 @@

import junit.framework.Assert;

import org.jumpmind.symmetric.csv.CsvWriter;
import org.jumpmind.symmetric.io.data.CsvUtils;
import org.junit.Test;

Expand All @@ -35,8 +36,8 @@ public void testLastElementIsNull() {
}

@Test
public void testEscapeSingleQuote() {
Assert.assertEquals("'L\\'' Hospitalet',,'277000043'", CsvUtils.escapeCsvData(new String[] {"L\\' Hospitalet",null,"277000043"}, '\n', '\''));
public void testEscapeDoubledSingleQuote() {
Assert.assertEquals("'L\\'' Hospitalet',,'277000043'\n", CsvUtils.escapeCsvData(new String[] {"L\\' Hospitalet",null,"277000043"}, '\n', '\'', CsvWriter.ESCAPE_MODE_DOUBLED));

}

Expand Down

0 comments on commit 4c5feb4

Please sign in to comment.