@@ -188,13 +188,13 @@ defmodule EnumTest.List do
188
188
assert Enum . split ( [ 1 , 2 , 3 ] , - 10 ) == { [ ] , [ 1 , 2 , 3 ] }
189
189
end
190
190
191
- test :split_with do
192
- assert Enum . split_with ( [ 1 , 2 , 3 ] , fn ( _ ) -> false end ) == { [ ] , [ 1 , 2 , 3 ] }
193
- assert Enum . split_with ( [ 1 , 2 , 3 ] , fn ( _ ) -> true end ) == { [ 1 , 2 , 3 ] , [ ] }
194
- assert Enum . split_with ( [ 1 , 2 , 3 ] , fn ( x ) -> x > 2 end ) == { [ ] , [ 1 , 2 , 3 ] }
195
- assert Enum . split_with ( [ 1 , 2 , 3 ] , fn ( x ) -> x > 3 end ) == { [ ] , [ 1 , 2 , 3 ] }
196
- assert Enum . split_with ( [ 1 , 2 , 3 ] , fn ( x ) -> x < 3 end ) == { [ 1 , 2 ] , [ 3 ] }
197
- assert Enum . split_with ( [ ] , fn ( _ ) -> true end ) == { [ ] , [ ] }
191
+ test :split_while do
192
+ assert Enum . split_while ( [ 1 , 2 , 3 ] , fn ( _ ) -> false end ) == { [ ] , [ 1 , 2 , 3 ] }
193
+ assert Enum . split_while ( [ 1 , 2 , 3 ] , fn ( _ ) -> true end ) == { [ 1 , 2 , 3 ] , [ ] }
194
+ assert Enum . split_while ( [ 1 , 2 , 3 ] , fn ( x ) -> x > 2 end ) == { [ ] , [ 1 , 2 , 3 ] }
195
+ assert Enum . split_while ( [ 1 , 2 , 3 ] , fn ( x ) -> x > 3 end ) == { [ ] , [ 1 , 2 , 3 ] }
196
+ assert Enum . split_while ( [ 1 , 2 , 3 ] , fn ( x ) -> x < 3 end ) == { [ 1 , 2 ] , [ 3 ] }
197
+ assert Enum . split_while ( [ ] , fn ( _ ) -> true end ) == { [ ] , [ ] }
198
198
end
199
199
200
200
test :take do
@@ -499,16 +499,16 @@ defmodule EnumTest.Range do
499
499
assert Enum . split ( range , 3 ) == { [ 1 , 0 ] , [ ] }
500
500
end
501
501
502
- test :split_with do
502
+ test :split_while do
503
503
range = Range . new ( first: 1 , last: 3 )
504
- assert Enum . split_with ( range , fn ( _ ) -> false end ) == { [ ] , [ 1 , 2 , 3 ] }
505
- assert Enum . split_with ( range , fn ( _ ) -> true end ) == { [ 1 , 2 , 3 ] , [ ] }
506
- assert Enum . split_with ( range , fn ( x ) -> x > 2 end ) == { [ ] , [ 1 , 2 , 3 ] }
507
- assert Enum . split_with ( range , fn ( x ) -> x > 3 end ) == { [ ] , [ 1 , 2 , 3 ] }
508
- assert Enum . split_with ( range , fn ( x ) -> x < 3 end ) == { [ 1 , 2 ] , [ 3 ] }
504
+ assert Enum . split_while ( range , fn ( _ ) -> false end ) == { [ ] , [ 1 , 2 , 3 ] }
505
+ assert Enum . split_while ( range , fn ( _ ) -> true end ) == { [ 1 , 2 , 3 ] , [ ] }
506
+ assert Enum . split_while ( range , fn ( x ) -> x > 2 end ) == { [ ] , [ 1 , 2 , 3 ] }
507
+ assert Enum . split_while ( range , fn ( x ) -> x > 3 end ) == { [ ] , [ 1 , 2 , 3 ] }
508
+ assert Enum . split_while ( range , fn ( x ) -> x < 3 end ) == { [ 1 , 2 ] , [ 3 ] }
509
509
510
510
range = Range . new ( first: 1 , last: 0 )
511
- assert Enum . split_with ( range , fn ( _ ) -> true end ) == { [ 1 , 0 ] , [ ] }
511
+ assert Enum . split_while ( range , fn ( _ ) -> true end ) == { [ 1 , 0 ] , [ ] }
512
512
end
513
513
514
514
test :take do
0 commit comments