File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 3
3
* enhancements
4
4
5
5
* bug fix
6
+ * [ Dict] ` Enum.to_list ` and ` Dict.to_list ` now return the same results for dicts
6
7
* [ Mix] Fix a bug where ` mix deps.get ` was not retrieving nested dependencies
7
8
8
9
* deprecations
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ defmodule HashDict do
246
246
end
247
247
248
248
def to_list ( dict ) do
249
- dict_fold ( dict , [ ] , [ & 1 | & 2 ] )
249
+ dict_fold ( dict , [ ] , [ & 1 | & 2 ] ) |> :lists . reverse
250
250
end
251
251
252
252
@ doc """
Original file line number Diff line number Diff line change @@ -85,17 +85,23 @@ defmodule HashDictTest do
85
85
end
86
86
87
87
test :to_list do
88
- list = filled_dict ( 8 ) |> HashDict . to_list
88
+ dict = filled_dict ( 8 )
89
+ list = dict |> HashDict . to_list
89
90
assert length ( list ) == 8
90
91
assert { 1 , 1 } in list
92
+ assert list == Enum . to_list ( dict )
91
93
92
- list = filled_dict ( 20 ) |> HashDict . to_list
94
+ dict = filled_dict ( 20 )
95
+ list = dict |> HashDict . to_list
93
96
assert length ( list ) == 20
94
97
assert { 1 , 1 } in list
98
+ assert list == Enum . to_list ( dict )
95
99
96
- list = filled_dict ( 120 ) |> HashDict . to_list
100
+ dict = filled_dict ( 120 )
101
+ list = dict |> HashDict . to_list
97
102
assert length ( list ) == 120
98
103
assert { 1 , 1 } in list
104
+ assert list == Enum . to_list ( dict )
99
105
end
100
106
101
107
test :keys do
You can’t perform that action at this time.
0 commit comments