diff --git a/exercises/anagram/anagram_test.cpp b/exercises/anagram/anagram_test.cpp index 454f1139b..1503dd0ea 100644 --- a/exercises/anagram/anagram_test.cpp +++ b/exercises/anagram/anagram_test.cpp @@ -3,7 +3,7 @@ using namespace std; -// Anagram exercise test case data version 1.4.0 +// Anagram exercise test case data version 1.5.0 TEST_CASE("no_matches") { @@ -59,6 +59,15 @@ TEST_CASE("detects_three_anagrams") REQUIRE(expected == matches); } +TEST_CASE("detects_multiple_anagrams_with_different_case") +{ + auto subject = anagram::anagram("nose"); + auto matches = subject.matches({"Eons", "ONES"}); + vector expected{"Eons", "ONES"}; + + REQUIRE(expected == matches); +} + TEST_CASE("does_not_detect_non_anagrams_with_identical_checksum") { auto subject = anagram::anagram("mass"); @@ -121,4 +130,13 @@ TEST_CASE("words_are_not_anagrams_of_themselves_case_insensitive") REQUIRE(expected == matches); } + +TEST_CASE("words_other_than_themselves_can_be_anagrams") +{ + auto subject = anagram::anagram("LISTEN"); + auto matches = subject.matches({"Listen", "Silent", "LISTEN"}); + vector expected{"Silent"}; + + REQUIRE(expected == matches); +} #endif