|
36 | 36 | import java.io.StringReader; |
37 | 37 |
|
38 | 38 | import org.junit.Before; |
39 | | -import org.junit.Ignore; |
40 | 39 | import org.junit.Test; |
41 | 40 |
|
42 | 41 | /** |
@@ -311,48 +310,42 @@ public void testEscapedLF() throws Exception { |
311 | 310 | assertThat(lexer.nextToken(new Token()), hasContent("character" + LF + "Escaped")); |
312 | 311 | } |
313 | 312 |
|
314 | | - @Test |
| 313 | + @Test // TODO is this correct? Do we expect TAB to be un/escaped? |
315 | 314 | public void testEscapedTab() throws Exception { |
316 | 315 | final Lexer lexer = getLexer("character\\" + TAB + "Escaped", formatWithEscaping); |
317 | 316 | assertThat(lexer.nextToken(new Token()), hasContent("character" + TAB + "Escaped")); |
318 | 317 | } |
319 | 318 |
|
320 | | - @Test |
| 319 | + @Test // TODO is this correct? Do we expect BACKSPACE to be un/escaped? |
321 | 320 | public void testEscapeBackspace() throws Exception { |
322 | 321 | final Lexer lexer = getLexer("character\\" + BACKSPACE + "Escaped", formatWithEscaping); |
323 | 322 | assertThat(lexer.nextToken(new Token()), hasContent("character" + BACKSPACE + "Escaped")); |
324 | 323 | } |
325 | 324 |
|
326 | | - @Test |
| 325 | + @Test // TODO is this correct? Do we expect FF to be un/escaped? |
327 | 326 | public void testEscapeFF() throws Exception { |
328 | 327 | final Lexer lexer = getLexer("character\\" + FF + "Escaped", formatWithEscaping); |
329 | 328 | assertThat(lexer.nextToken(new Token()), hasContent("character" + FF + "Escaped")); |
330 | 329 | } |
331 | 330 |
|
332 | | - // FIXME this should work after CSV-58 is resolved. Currently the result will be "charactera\NEscaped" |
333 | 331 | @Test |
334 | | - @Ignore |
335 | 332 | public void testEscapedMySqlNullValue() throws Exception { |
336 | 333 | // MySQL uses \N to symbolize null values. We have to restore this |
337 | 334 | final Lexer lexer = getLexer("character\\NEscaped", formatWithEscaping); |
338 | 335 | assertThat(lexer.nextToken(new Token()), hasContent("character\\NEscaped")); |
339 | 336 | } |
340 | 337 |
|
341 | | - // FIXME this should work after CSV-58 is resolved. Currently the result will be "characteraEscaped" |
342 | 338 | @Test |
343 | | - @Ignore |
344 | 339 | public void testEscapedCharacter() throws Exception { |
345 | 340 | final Lexer lexer = getLexer("character\\aEscaped", formatWithEscaping); |
346 | 341 | assertThat(lexer.nextToken(new Token()), hasContent("character\\aEscaped")); |
347 | 342 | } |
348 | 343 |
|
349 | | - // FIXME this should work after CSV-58 is resolved. Currently the result will be "characterCREscaped" |
350 | 344 | @Test |
351 | | - @Ignore |
352 | 345 | public void testEscapedControlCharacter() throws Exception { |
353 | | - // we are explicitly using an escape different from \ here, because \r is the character sequence for CR |
| 346 | + // we are explicitly using an escape different from \ here |
354 | 347 | final Lexer lexer = getLexer("character!rEscaped", CSVFormat.newBuilder().withEscape('!').build()); |
355 | | - assertThat(lexer.nextToken(new Token()), hasContent("character!rEscaped")); |
| 348 | + assertThat(lexer.nextToken(new Token()), hasContent("character" + CR + "Escaped")); |
356 | 349 | } |
357 | 350 |
|
358 | 351 | @Test |
|
0 commit comments