File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
JavaReleases/src/test/java/pl/mperor/lab/java Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,25 @@ private static boolean nonEmptyString(Object obj) {
84
84
return (obj instanceof String str ) && !str .isEmpty ();
85
85
}
86
86
87
+ @ Test
88
+ public void testMapMultiForManagingExceptionsInParsing () {
89
+ String valuesAsString = """
90
+ 1
91
+ 2
92
+ @@@@@ buggy
93
+ 3""" ;
94
+
95
+ var parsed = valuesAsString .lines ()
96
+ .mapMultiToInt ((line , consumer ) -> {
97
+ try {
98
+ int i = Integer .parseInt (line );
99
+ consumer .accept (i );
100
+ } catch (NumberFormatException _) {}
101
+ }).toArray ();
102
+
103
+ Assertions .assertArrayEquals (new int []{1 , 2 , 3 }, parsed );
104
+ }
105
+
87
106
@ SuppressWarnings ({"removal" , "synchronization" })
88
107
@ Test
89
108
public void testValueBasedClasses () {
You can’t perform that action at this time.
0 commit comments