| 1 |
package ezvcard.issue; |
| 2 |
|
| 3 |
import ezvcard.Ezvcard; |
| 4 |
import ezvcard.VCard; |
| 5 |
import org.junit.Test; |
| 6 |
|
| 7 |
import static org.junit.Assert.assertEquals; |
| 8 |
import static org.junit.Assert.fail; |
| 9 |
|
| 10 |
import java.io.InputStream; |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
public class Issue114 { |
| 17 |
@Test |
| 18 |
public void test() throws Exception { |
| 19 |
VCard vcard; |
| 20 |
try (InputStream in = getClass().getResourceAsStream("issue114.vcf")) { |
| 21 |
vcard = Ezvcard.parse(in).first(); |
| 22 |
} |
| 23 |
|
| 24 |
try { |
| 25 |
Ezvcard.write(vcard).go(); |
| 26 |
fail(); |
| 27 |
} catch (IllegalArgumentException e) { |
| 28 |
assertEquals("Property \"ADR\" has a parameter named \"LABEL\" whose value contains one or more invalid characters. The following characters are not permitted: [ \\n \\r \" ]", e.getMessage()); |
| 29 |
} |
| 30 |
|
| 31 |
Ezvcard.write(vcard).caretEncoding(true).go(); |
| 32 |
} |
| 33 |
} |