@@ -21,11 +21,50 @@ public class UnixStreamImplTest {
21
21
22
22
private Stream <String > stream ;
23
23
24
+ private UnixStream <String > unixStream ;
25
+
24
26
@ Before
25
27
public void setUp () {
26
28
stream = Stream .of ("id,name" , "1,foo" , "2,bar" );
27
29
}
28
30
31
+ @ Test
32
+ public void compact () throws Exception {
33
+ stream = Stream .of (" f o o " );
34
+ unixStream = new UnixStreamImpl <>(stream );
35
+
36
+ assertThat (unixStream .compact ()).containsExactly ("foo" );
37
+ }
38
+
39
+ @ Test
40
+ public void concat () throws Exception {
41
+ stream = Stream .of ("foo" );
42
+ unixStream = new UnixStreamImpl <>(stream );
43
+
44
+ assertThat (unixStream .concat (Stream .of ("bar" ))).containsExactly ("foo" , "bar" );
45
+ }
46
+
47
+ @ Test
48
+ public void cut () throws Exception {
49
+ stream = Stream .of ("1;foo" );
50
+ unixStream = new UnixStreamImpl <>(stream );
51
+
52
+ assertThat (unixStream .cut (";" , 2 )).containsExactly ("foo" );
53
+ }
54
+
55
+ @ Test
56
+ public void dos2unix () throws Exception {
57
+ stream = Stream .of ("a\r \n " , "b\r \n c\r \n " );
58
+ unixStream = new UnixStreamImpl <>(stream );
59
+
60
+ assertThat (unixStream .dos2unix ()).containsExactly ("a\n " , "b\n c\n " );
61
+ }
62
+
63
+ @ Test
64
+ public void getShouldReturnTheOriginalStream () throws Exception {
65
+ assertThat (UnixStream .unixify (stream ).get ()).isEqualTo (stream );
66
+ }
67
+
29
68
@ Test
30
69
public void integrationTest1 () throws IOException {
31
70
List <String > strings = UnixStream .unixify (stream )
@@ -62,8 +101,4 @@ public void integrationTest3() throws IOException {
62
101
assertThat (items ).isNotNull ().isNotEmpty ().hasSize (2 ).containsExactly ("name" , "bar" );
63
102
}
64
103
65
- @ Test
66
- public void getShouldReturnTheOriginalStream () throws Exception {
67
- assertThat (UnixStream .unixify (stream ).get ()).isEqualTo (stream );
68
- }
69
104
}
0 commit comments