1 | void testOneLiner() throws IOException {↵ | | 1 | void testMultiLiner2() throws IOException {↵
|
2 | String line = "This is a test";↵ | | 2 | String line = "This is a test\nForget the rest\n\n\n";↵
|
3 | InputStream in = new ByteArrayInputStream(line.getBytes());↵ | | 3 | InputStream in = new ByteArrayInputStream(line.getBytes());↵
|
|
4 | StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(↵ | | 4 | StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(↵
|
5 | in));↵ | | 5 | in));↵
|
6 | assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));↵ | | 6 | assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));↵
|
7 | }↵ | | 7 | }↵
|
|
8 | public void testMultiLiner1() throws IOException {↵ | | 8 | public void testMultiLiner3() throws IOException {↵
|
9 | String line = "This is a test\nForget the rest\n\n";↵ | | 9 | String line = "\nThis is a test\nForget the rest\n\n\n";↵
|
10 | InputStream in = new ByteArrayInputStream(line.getBytes());↵ | | 10 | InputStream in = new ByteArrayInputStream(line.getBytes());↵
|
|
11 | StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(↵ | | 11 | StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(↵
|
12 | in));↵ | | 12 | in));↵
|
13 | assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));↵ | | 13 | assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));↵
|
14 | | | 14 |
|