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