File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,6 +153,9 @@ get_enumerator(Map) when is_map(Map) ->
153153get_enumerator ({group_collection , Items , _Names }) ->
154154 % % Regex GroupCollection: iterate over the group items list
155155 get_enumerator (Items );
156+ get_enumerator (Bin ) when is_binary (Bin ) ->
157+ % % String binary used as seq<char>: enumerate Unicode codepoints.
158+ get_enumerator (unicode :characters_to_list (Bin ));
156159get_enumerator (Other ) ->
157160 % % Fallback: treat as list
158161 get_enumerator (lists :flatten ([Other ])).
Original file line number Diff line number Diff line change @@ -1055,3 +1055,25 @@ let ``test String.forall works`` () =
10551055 " aaa" |> String.forall ( fun c -> c = 'a' ) |> equal true
10561056 " aab" |> String.forall ( fun c -> c = 'a' ) |> equal false
10571057 " " |> String.forall ( fun c -> c = 'a' ) |> equal true
1058+
1059+ [<Fact>]
1060+ let ``test Seq.mapi over string works`` () =
1061+ " Hello"
1062+ |> Seq.mapi ( fun _ c -> string c)
1063+ |> String.concat " "
1064+ |> equal " Hello"
1065+
1066+ [<Fact>]
1067+ let ``test Seq.map over string works`` () =
1068+ " abc"
1069+ |> Seq.map ( fun c -> string c)
1070+ |> String.concat " -"
1071+ |> equal " a-b-c"
1072+
1073+ [<Fact>]
1074+ let ``test Seq.toList over string works`` () =
1075+ " abc" |> Seq.toList |> equal [ 'a' ; 'b' ; 'c' ]
1076+
1077+ [<Fact>]
1078+ let ``test Seq.length over string works`` () =
1079+ " Hello" |> Seq.length |> equal 5
You can’t perform that action at this time.
0 commit comments