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

[Anagram]: Updated Tests from problem-specifications #3647

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions exercises/practice/anagram/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ include = false
[33d3f67e-fbb9-49d3-a90e-0beb00861da7]
description = "words other than themselves can be anagrams"
reimplements = "a0705568-628c-4b55-9798-82e4acde51ca"

[a6854f66-eec1-4afd-a137-62ef2870c051]
description = "handles case of greek letters"

[fd3509e5-e3ba-409d-ac3d-a9ac84d13296]
description = "different characters may have the same bytes"
12 changes: 11 additions & 1 deletion exercises/practice/anagram/anagram_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/anagram/canonical-data.json
# File last updated on 2023-12-27
# File last updated on 2024-02-28

import unittest

Expand Down Expand Up @@ -93,3 +93,13 @@ def test_words_other_than_themselves_can_be_anagrams(self):
candidates = ["LISTEN", "Silent"]
expected = ["Silent"]
self.assertCountEqual(find_anagrams("LISTEN", candidates), expected)

def test_handles_case_of_greek_letters(self):
candidates = ["ΒΓΑ", "ΒΓΔ", "γβα", "αβγ"]
expected = ["ΒΓΑ", "γβα"]
self.assertCountEqual(find_anagrams("ΑΒΓ", candidates), expected)

def test_different_characters_may_have_the_same_bytes(self):
candidates = ["€a"]
expected = []
self.assertCountEqual(find_anagrams("a⬂", candidates), expected)
Loading