@@ -356,8 +356,30 @@ public synchronized int read(byte[] b, int off, int len) {
356356 }
357357
358358 @ Test
359- public void testByLine () {
360- String newLine = System .getProperty ("line.separator" );
359+ public void testByLine_Newline () {
360+ String newLine = String .valueOf (new char [] { 10 });
361+
362+ List <String > lines = byLine (
363+ Observable .from (Arrays .asList ("qwer" , newLine + "asdf" + newLine , "zx" , "cv" )))
364+ .toList ().toBlocking ().single ();
365+
366+ assertEquals (Arrays .asList ("qwer" , "asdf" , "zxcv" ), lines );
367+ }
368+
369+ @ Test
370+ public void testByLine_CarriageNewline () {
371+ String newLine = String .valueOf (new char [] { 13 , 10 });
372+
373+ List <String > lines = byLine (
374+ Observable .from (Arrays .asList ("qwer" , newLine + "asdf" + newLine , "zx" , "cv" )))
375+ .toList ().toBlocking ().single ();
376+
377+ assertEquals (Arrays .asList ("qwer" , "asdf" , "zxcv" ), lines );
378+ }
379+
380+ @ Test
381+ public void testByLine_Carriage () {
382+ String newLine = String .valueOf (new char [] { 13 });
361383
362384 List <String > lines = byLine (
363385 Observable .from (Arrays .asList ("qwer" , newLine + "asdf" + newLine , "zx" , "cv" )))
0 commit comments