Skip to content

Commit

Permalink
Order of items in set have changed, weird.
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Feb 2, 2014
1 parent 572e99c commit 4aa543a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 25-set.exs
Expand Up @@ -5,12 +5,12 @@ defmodule SetTest do


test "to_list" do test "to_list" do
list = HashSet.new([1, 2, 2, 3]) |> HashSet.to_list list = HashSet.new([1, 2, 2, 3]) |> HashSet.to_list
assert list == [1, 2, 3] assert list == [2, 3, 1] # unintuitive ordering
end end


test "union" do test "union" do
union = HashSet.new([1, 2, 3]) |> HashSet.union(HashSet.new([2, 3, 4])) union = HashSet.new([1, 2, 3]) |> HashSet.union(HashSet.new([2, 3, 4]))
assert Set.to_list(union) == [1, 2, 3, 4] assert Set.to_list(union) == [2, 3, 4, 1] # unintuitive, but somewhat more understandable
end end


test "intersection" do test "intersection" do
Expand Down

0 comments on commit 4aa543a

Please sign in to comment.