Testing Elixir - MapSet.new vs. Enum.sort in unit test example

Title: Testing Elixir - MapSet.new vs. Enum.sort (p. 80 PDF)

The example on this page shows an assertion with the code:

code: assert Enum.sort(actual_fields_with_types) ==
       Enum.sort(@expected_fields_with_types)

But the previous code example (p.77) uses MapSet.New instead of Enum.sort:

code: assert MapSet.new(actual_fields_with_types) ==
       MapSet.new(@expected_fields_with_types)

Not sure which is better, TBH. :smiley:

Also while I’m here – p83, there’s a typo, attibribute should be attribute. :smiley:

…Paul

2 Likes