Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch: remove order dependency from anagram test cases #1545

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions exercises/practice/anagram/test/anagram_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule AnagramTest do
@tag :pending
test "detects two anagrams" do
matches = Anagram.match("solemn", ~w(lemons cherry melons))
assert matches == ~w(lemons melons)
assert Enum.sort(matches) == Enum.sort(~w(lemons melons))
end

@tag :pending
Expand All @@ -28,13 +28,13 @@ defmodule AnagramTest do
@tag :pending
test "detects three anagrams" do
matches = Anagram.match("allergy", ~w(gallery ballerina regally clergy largely leading))
assert matches == ~w(gallery regally largely)
assert Enum.sort(matches) == Enum.sort(~w(gallery regally largely))
end

@tag :pending
test "detects multiple anagrams with different case" do
matches = Anagram.match("nose", ~w(Eons ONES))
assert matches == ~w(Eons ONES)
assert Enum.sort(matches) == Enum.sort(~w(Eons ONES))
end

@tag :pending
Expand Down Expand Up @@ -100,7 +100,7 @@ defmodule AnagramTest do
@tag :pending
test "handles case of greek letters" do
matches = Anagram.match("ΑΒΓ", ~w(ΒΓΑ ΒΓΔ γβα αβγ))
assert matches == ~w(ΒΓΑ γβα)
assert Enum.sort(matches) == Enum.sort(~w(ΒΓΑ γβα))
end

@tag :pending
Expand Down
Loading