@@ -797,7 +797,7 @@ let unfoldTests =
797
797
),
798
798
])
799
799
800
- let expandTests = {
800
+ let unfoldManyTests = {
801
801
// for a given seed string, return each character and a new seed which is all
802
802
// the characters that follow it
803
803
let combos = s => {
@@ -815,14 +815,19 @@ let expandTests = {
815
815
-> Seq .fromArray
816
816
817
817
makeSeqEqualsTests (
818
- ~title = "expand " ,
818
+ ~title = "unfoldMany " ,
819
819
[
820
- (S .expand ("abcd" , combos )-> format , ["abcd" , "abd" , "acd" , "ad" , "bcd" , "bd" , "cd" , "d" ], "" ),
821
- (S .expand ("abc" , combos )-> format , ["abc" , "ac" , "bc" , "c" ], "" ),
822
- (S .expand ("ab" , combos )-> format , ["ab" , "b" ], "" ),
823
- (S .expand ("a" , combos )-> format , ["a" ], "" ),
824
820
(
825
- S .expand ("abcdefghijklmnopqrstuv" , combos )
821
+ S .unfoldMany ("abcd" , combos )-> format ,
822
+ ["abcd" , "abd" , "acd" , "ad" , "bcd" , "bd" , "cd" , "d" ],
823
+ "" ,
824
+ ),
825
+ (S .unfoldMany ("abc" , combos )-> format , ["abc" , "ac" , "bc" , "c" ], "" ),
826
+ (S .unfoldMany ("ab" , combos )-> format , ["ab" , "b" ], "" ),
827
+ (S .unfoldMany ("a" , combos )-> format , ["a" ], "" ),
828
+ (S .unfoldMany ("" , combos )-> format , ["" ], "" ),
829
+ (
830
+ S .unfoldMany ("abcdefghijklmnopqrstuv" , combos )
826
831
-> Seq .last
827
832
-> Option .map (s => s -> Seq .once -> format )
828
833
-> Option .getExn ,
@@ -2265,7 +2270,7 @@ let tests =
2265
2270
everySomeTests ,
2266
2271
everyTests ,
2267
2272
exactlyOneTests ,
2268
- expandTests ,
2273
+ unfoldManyTests ,
2269
2274
filterMapiTests ,
2270
2275
filterMapTests ,
2271
2276
filterOkTests ,
0 commit comments