@@ -797,7 +797,7 @@ let unfoldTests =
797797 ),
798798 ])
799799
800- let expandTests = {
800+ let unfoldManyTests = {
801801 // for a given seed string, return each character and a new seed which is all
802802 // the characters that follow it
803803 let combos = s => {
@@ -815,14 +815,19 @@ let expandTests = {
815815 -> Seq .fromArray
816816
817817 makeSeqEqualsTests (
818- ~title = "expand " ,
818+ ~title = "unfoldMany " ,
819819 [
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" ], "" ),
824820 (
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 )
826831 -> Seq .last
827832 -> Option .map (s => s -> Seq .once -> format )
828833 -> Option .getExn ,
@@ -2265,7 +2270,7 @@ let tests =
22652270 everySomeTests ,
22662271 everyTests ,
22672272 exactlyOneTests ,
2268- expandTests ,
2273+ unfoldManyTests ,
22692274 filterMapiTests ,
22702275 filterMapTests ,
22712276 filterOkTests ,
0 commit comments