Test default Quote policy

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1480498 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2013-05-08 23:43:14 +00:00
parent 71c69df6dd
commit bb3bb0d65b
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import static org.apache.commons.csv.Constants.LF;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.apache.commons.csv.CSVFormat.CSVFormatBuilder;
@ -153,6 +154,11 @@ public class CSVFormatBuilderTest {
assertEquals(Quote.ALL, builder.withQuotePolicy(Quote.ALL).build().getQuotePolicy());
}
@Test
public void testDefaultQuotePolicy() {
assertNull(builder.build().getQuotePolicy());
}
@Test(expected = IllegalStateException.class)
public void testQuotePolicyNoneWithoutEscapeThrowsException() {
CSVFormat.newBuilder('!').withQuotePolicy(Quote.NONE).build();