From 0a8455fa66c18686667253671b16209fd4e87f5c Mon Sep 17 00:00:00 2001 From: Christian Willner <34183939+vaeng@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:54:47 +0100 Subject: [PATCH] tests: update allergy exercise (#817) --- exercises/practice/allergies/.meta/tests.toml | 114 ++++---- .../practice/allergies/allergies_test.cpp | 267 +++++++++++------- 2 files changed, 230 insertions(+), 151 deletions(-) diff --git a/exercises/practice/allergies/.meta/tests.toml b/exercises/practice/allergies/.meta/tests.toml index 8a754c20d..799ab8563 100644 --- a/exercises/practice/allergies/.meta/tests.toml +++ b/exercises/practice/allergies/.meta/tests.toml @@ -1,150 +1,160 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [17fc7296-2440-4ac4-ad7b-d07c321bc5a0] -description = "not allergic to anything" +description = "testing for eggs allergy -> not allergic to anything" [07ced27b-1da5-4c2e-8ae2-cb2791437546] -description = "allergic only to eggs" +description = "testing for eggs allergy -> allergic only to eggs" [5035b954-b6fa-4b9b-a487-dae69d8c5f96] -description = "allergic to eggs and something else" +description = "testing for eggs allergy -> allergic to eggs and something else" [64a6a83a-5723-4b5b-a896-663307403310] -description = "allergic to something, but not eggs" +description = "testing for eggs allergy -> allergic to something, but not eggs" [90c8f484-456b-41c4-82ba-2d08d93231c6] -description = "allergic to everything" +description = "testing for eggs allergy -> allergic to everything" [d266a59a-fccc-413b-ac53-d57cb1f0db9d] -description = "not allergic to anything" +description = "testing for peanuts allergy -> not allergic to anything" [ea210a98-860d-46b2-a5bf-50d8995b3f2a] -description = "allergic only to peanuts" +description = "testing for peanuts allergy -> allergic only to peanuts" [eac69ae9-8d14-4291-ac4b-7fd2c73d3a5b] -description = "allergic to peanuts and something else" +description = "testing for peanuts allergy -> allergic to peanuts and something else" [9152058c-ce39-4b16-9b1d-283ec6d25085] -description = "allergic to something, but not peanuts" +description = "testing for peanuts allergy -> allergic to something, but not peanuts" [d2d71fd8-63d5-40f9-a627-fbdaf88caeab] -description = "allergic to everything" +description = "testing for peanuts allergy -> allergic to everything" [b948b0a1-cbf7-4b28-a244-73ff56687c80] -description = "not allergic to anything" +description = "testing for shellfish allergy -> not allergic to anything" [9ce9a6f3-53e9-4923-85e0-73019047c567] -description = "allergic only to shellfish" +description = "testing for shellfish allergy -> allergic only to shellfish" [b272fca5-57ba-4b00-bd0c-43a737ab2131] -description = "allergic to shellfish and something else" +description = "testing for shellfish allergy -> allergic to shellfish and something else" [21ef8e17-c227-494e-8e78-470a1c59c3d8] -description = "allergic to something, but not shellfish" +description = "testing for shellfish allergy -> allergic to something, but not shellfish" [cc789c19-2b5e-4c67-b146-625dc8cfa34e] -description = "allergic to everything" +description = "testing for shellfish allergy -> allergic to everything" [651bde0a-2a74-46c4-ab55-02a0906ca2f5] -description = "not allergic to anything" +description = "testing for strawberries allergy -> not allergic to anything" [b649a750-9703-4f5f-b7f7-91da2c160ece] -description = "allergic only to strawberries" +description = "testing for strawberries allergy -> allergic only to strawberries" [50f5f8f3-3bac-47e6-8dba-2d94470a4bc6] -description = "allergic to strawberries and something else" +description = "testing for strawberries allergy -> allergic to strawberries and something else" [23dd6952-88c9-48d7-a7d5-5d0343deb18d] -description = "allergic to something, but not strawberries" +description = "testing for strawberries allergy -> allergic to something, but not strawberries" [74afaae2-13b6-43a2-837a-286cd42e7d7e] -description = "allergic to everything" +description = "testing for strawberries allergy -> allergic to everything" [c49a91ef-6252-415e-907e-a9d26ef61723] -description = "not allergic to anything" +description = "testing for tomatoes allergy -> not allergic to anything" [b69c5131-b7d0-41ad-a32c-e1b2cc632df8] -description = "allergic only to tomatoes" +description = "testing for tomatoes allergy -> allergic only to tomatoes" [1ca50eb1-f042-4ccf-9050-341521b929ec] -description = "allergic to tomatoes and something else" +description = "testing for tomatoes allergy -> allergic to tomatoes and something else" [e9846baa-456b-4eff-8025-034b9f77bd8e] -description = "allergic to something, but not tomatoes" +description = "testing for tomatoes allergy -> allergic to something, but not tomatoes" [b2414f01-f3ad-4965-8391-e65f54dad35f] -description = "allergic to everything" +description = "testing for tomatoes allergy -> allergic to everything" [978467ab-bda4-49f7-b004-1d011ead947c] -description = "not allergic to anything" +description = "testing for chocolate allergy -> not allergic to anything" [59cf4e49-06ea-4139-a2c1-d7aad28f8cbc] -description = "allergic only to chocolate" +description = "testing for chocolate allergy -> allergic only to chocolate" [b0a7c07b-2db7-4f73-a180-565e07040ef1] -description = "allergic to chocolate and something else" +description = "testing for chocolate allergy -> allergic to chocolate and something else" [f5506893-f1ae-482a-b516-7532ba5ca9d2] -description = "allergic to something, but not chocolate" +description = "testing for chocolate allergy -> allergic to something, but not chocolate" [02debb3d-d7e2-4376-a26b-3c974b6595c6] -description = "allergic to everything" +description = "testing for chocolate allergy -> allergic to everything" [17f4a42b-c91e-41b8-8a76-4797886c2d96] -description = "not allergic to anything" +description = "testing for pollen allergy -> not allergic to anything" [7696eba7-1837-4488-882a-14b7b4e3e399] -description = "allergic only to pollen" +description = "testing for pollen allergy -> allergic only to pollen" [9a49aec5-fa1f-405d-889e-4dfc420db2b6] -description = "allergic to pollen and something else" +description = "testing for pollen allergy -> allergic to pollen and something else" [3cb8e79f-d108-4712-b620-aa146b1954a9] -description = "allergic to something, but not pollen" +description = "testing for pollen allergy -> allergic to something, but not pollen" [1dc3fe57-7c68-4043-9d51-5457128744b2] -description = "allergic to everything" +description = "testing for pollen allergy -> allergic to everything" [d3f523d6-3d50-419b-a222-d4dfd62ce314] -description = "not allergic to anything" +description = "testing for cats allergy -> not allergic to anything" [eba541c3-c886-42d3-baef-c048cb7fcd8f] -description = "allergic only to cats" +description = "testing for cats allergy -> allergic only to cats" [ba718376-26e0-40b7-bbbe-060287637ea5] -description = "allergic to cats and something else" +description = "testing for cats allergy -> allergic to cats and something else" [3c6dbf4a-5277-436f-8b88-15a206f2d6c4] -description = "allergic to something, but not cats" +description = "testing for cats allergy -> allergic to something, but not cats" [1faabb05-2b98-4995-9046-d83e4a48a7c1] -description = "allergic to everything" +description = "testing for cats allergy -> allergic to everything" [f9c1b8e7-7dc5-4887-aa93-cebdcc29dd8f] -description = "no allergies" +description = "list when: -> no allergies" [9e1a4364-09a6-4d94-990f-541a94a4c1e8] -description = "just eggs" +description = "list when: -> just eggs" [8851c973-805e-4283-9e01-d0c0da0e4695] -description = "just peanuts" +description = "list when: -> just peanuts" [2c8943cb-005e-435f-ae11-3e8fb558ea98] -description = "just strawberries" +description = "list when: -> just strawberries" [6fa95d26-044c-48a9-8a7b-9ee46ec32c5c] -description = "eggs and peanuts" +description = "list when: -> eggs and peanuts" [19890e22-f63f-4c5c-a9fb-fb6eacddfe8e] -description = "more than eggs but not peanuts" +description = "list when: -> more than eggs but not peanuts" [4b68f470-067c-44e4-889f-c9fe28917d2f] -description = "lots of stuff" +description = "list when: -> lots of stuff" [0881b7c5-9efa-4530-91bd-68370d054bc7] -description = "everything" +description = "list when: -> everything" [12ce86de-b347-42a0-ab7c-2e0570f0c65b] -description = "no allergen score parts" +description = "list when: -> no allergen score parts" + +[93c2df3e-4f55-4fed-8116-7513092819cd] +description = "list when: -> no allergen score parts without highest valid score" diff --git a/exercises/practice/allergies/allergies_test.cpp b/exercises/practice/allergies/allergies_test.cpp index a1f8ca694..0049a9c47 100644 --- a/exercises/practice/allergies/allergies_test.cpp +++ b/exercises/practice/allergies/allergies_test.cpp @@ -5,147 +5,216 @@ #include "test/catch.hpp" #endif -#include -#include - -TEST_CASE("no_allergies_means_not_allergic") -{ - allergies::allergy_test score(0); - - REQUIRE(false == score.is_allergic_to("peanuts")); - REQUIRE(false == score.is_allergic_to("cats")); - REQUIRE(false == score.is_allergic_to("strawberries")); +TEST_CASE("testing for eggs allergy -> not allergic to anything", "[17fc7296-2440-4ac4-ad7b-d07c321bc5a0]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("eggs")); } #if defined(EXERCISM_RUN_ALL_TESTS) -TEST_CASE("allergic_to_eggs") -{ - allergies::allergy_test score(1); - - REQUIRE(true == score.is_allergic_to("eggs")); + +TEST_CASE("testing for eggs allergy -> allergic only to eggs", "[07ced27b-1da5-4c2e-8ae2-cb2791437546]") { + REQUIRE(true == allergies::allergy_test(1).is_allergic_to("eggs")); +} + +TEST_CASE("testing for eggs allergy -> allergic to eggs and something else", "[5035b954-b6fa-4b9b-a487-dae69d8c5f96]") { + REQUIRE(true == allergies::allergy_test(3).is_allergic_to("eggs")); +} + +TEST_CASE("testing for eggs allergy -> allergic to something, but not eggs", "[64a6a83a-5723-4b5b-a896-663307403310]") { + REQUIRE(false == allergies::allergy_test(2).is_allergic_to("eggs")); +} + +TEST_CASE("testing for eggs allergy -> allergic to everything", "[90c8f484-456b-41c4-82ba-2d08d93231c6]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("eggs")); +} + +TEST_CASE("testing for peanuts allergy -> not allergic to anything", "[d266a59a-fccc-413b-ac53-d57cb1f0db9d]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("peanuts")); +} + +TEST_CASE("testing for peanuts allergy -> allergic only to peanuts", "[ea210a98-860d-46b2-a5bf-50d8995b3f2a]") { + REQUIRE(true == allergies::allergy_test(2).is_allergic_to("peanuts")); +} + +TEST_CASE("testing for peanuts allergy -> allergic to peanuts and something else", "[eac69ae9-8d14-4291-ac4b-7fd2c73d3a5b]") { + REQUIRE(true == allergies::allergy_test(7).is_allergic_to("peanuts")); +} + +TEST_CASE("testing for peanuts allergy -> allergic to something, but not peanuts", "[9152058c-ce39-4b16-9b1d-283ec6d25085]") { + REQUIRE(false == allergies::allergy_test(5).is_allergic_to("peanuts")); } -TEST_CASE("allergic_to_peanuts") -{ - allergies::allergy_test score(2); - - REQUIRE(true == score.is_allergic_to("peanuts")); +TEST_CASE("testing for peanuts allergy -> allergic to everything", "[d2d71fd8-63d5-40f9-a627-fbdaf88caeab]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("peanuts")); } -TEST_CASE("allergic_to_shellfish") -{ - allergies::allergy_test score(4); - - REQUIRE(true == score.is_allergic_to("shellfish")); +TEST_CASE("testing for shellfish allergy -> not allergic to anything", "[b948b0a1-cbf7-4b28-a244-73ff56687c80]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("shellfish")); } -TEST_CASE("allergic_to_strawberries") -{ - allergies::allergy_test score(8); - - REQUIRE(true == score.is_allergic_to("strawberries")); +TEST_CASE("testing for shellfish allergy -> allergic only to shellfish", "[9ce9a6f3-53e9-4923-85e0-73019047c567]") { + REQUIRE(true == allergies::allergy_test(4).is_allergic_to("shellfish")); } -TEST_CASE("allergic_to_tomatoes") -{ - allergies::allergy_test score(16); - - REQUIRE(true == score.is_allergic_to("tomatoes")); +TEST_CASE("testing for shellfish allergy -> allergic to shellfish and something else", "[b272fca5-57ba-4b00-bd0c-43a737ab2131]") { + REQUIRE(true == allergies::allergy_test(14).is_allergic_to("shellfish")); } -TEST_CASE("allergic_to_chocolate") -{ - allergies::allergy_test score(32); - - REQUIRE(true == score.is_allergic_to("chocolate")); +TEST_CASE("testing for shellfish allergy -> allergic to something, but not shellfish", "[21ef8e17-c227-494e-8e78-470a1c59c3d8]") { + REQUIRE(false == allergies::allergy_test(10).is_allergic_to("shellfish")); } -TEST_CASE("allergic_to_pollen") -{ - allergies::allergy_test score(64); - - REQUIRE(true == score.is_allergic_to("pollen")); +TEST_CASE("testing for shellfish allergy -> allergic to everything", "[cc789c19-2b5e-4c67-b146-625dc8cfa34e]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("shellfish")); } -TEST_CASE("allergic_to_cats") -{ - allergies::allergy_test score(128); - - REQUIRE(true == score.is_allergic_to("cats")); +TEST_CASE("testing for strawberries allergy -> not allergic to anything", "[651bde0a-2a74-46c4-ab55-02a0906ca2f5]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("strawberries")); } -TEST_CASE("allergic_to_eggs_and_other_stuff") -{ - allergies::allergy_test score(5); - - REQUIRE(true == score.is_allergic_to("eggs")); - REQUIRE(true == score.is_allergic_to("shellfish")); - REQUIRE(false == score.is_allergic_to("peanuts")); +TEST_CASE("testing for strawberries allergy -> allergic only to strawberries", "[b649a750-9703-4f5f-b7f7-91da2c160ece]") { + REQUIRE(true == allergies::allergy_test(8).is_allergic_to("strawberries")); } -TEST_CASE("allergic_to_nothing") -{ - allergies::allergy_test score(0); - const std::unordered_set no_allergies{}; +TEST_CASE("testing for strawberries allergy -> allergic to strawberries and something else", "[50f5f8f3-3bac-47e6-8dba-2d94470a4bc6]") { + REQUIRE(true == allergies::allergy_test(28).is_allergic_to("strawberries")); +} - REQUIRE(no_allergies == score.get_allergies()); +TEST_CASE("testing for strawberries allergy -> allergic to something, but not strawberries", "[23dd6952-88c9-48d7-a7d5-5d0343deb18d]") { + REQUIRE(false == allergies::allergy_test(20).is_allergic_to("strawberries")); } -TEST_CASE("allergic_to_only_peanuts") -{ - allergies::allergy_test score(2); - const std::unordered_set only_peanuts = {"peanuts"}; +TEST_CASE("testing for strawberries allergy -> allergic to everything", "[74afaae2-13b6-43a2-837a-286cd42e7d7e]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("strawberries")); +} - REQUIRE(only_peanuts == score.get_allergies()); +TEST_CASE("testing for tomatoes allergy -> not allergic to anything", "[c49a91ef-6252-415e-907e-a9d26ef61723]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("tomatoes")); } -TEST_CASE("allergic_to_only_strawberries") -{ - allergies::allergy_test score(8); - const std::unordered_set only_strawberries = {"strawberries"}; +TEST_CASE("testing for tomatoes allergy -> allergic only to tomatoes", "[b69c5131-b7d0-41ad-a32c-e1b2cc632df8]") { + REQUIRE(true == allergies::allergy_test(16).is_allergic_to("tomatoes")); +} - REQUIRE(only_strawberries == score.get_allergies()); +TEST_CASE("testing for tomatoes allergy -> allergic to tomatoes and something else", "[1ca50eb1-f042-4ccf-9050-341521b929ec]") { + REQUIRE(true == allergies::allergy_test(56).is_allergic_to("tomatoes")); } -TEST_CASE("allergic_to_eggs_and_peanuts") -{ - allergies::allergy_test score(3); - const std::unordered_set eggs_peanuts = {"eggs", "peanuts"}; +TEST_CASE("testing for tomatoes allergy -> allergic to something, but not tomatoes", "[e9846baa-456b-4eff-8025-034b9f77bd8e]") { + REQUIRE(false == allergies::allergy_test(40).is_allergic_to("tomatoes")); +} - REQUIRE(eggs_peanuts == score.get_allergies()); +TEST_CASE("testing for tomatoes allergy -> allergic to everything", "[b2414f01-f3ad-4965-8391-e65f54dad35f]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("tomatoes")); } -TEST_CASE("allergic_to_more_than_eggs_but_not_peanuts") -{ - allergies::allergy_test score(5); - const std::unordered_set eggs_shellfish = {"eggs", "shellfish"}; +TEST_CASE("testing for chocolate allergy -> not allergic to anything", "[978467ab-bda4-49f7-b004-1d011ead947c]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("chocolate")); +} - REQUIRE(eggs_shellfish == score.get_allergies()); +TEST_CASE("testing for chocolate allergy -> allergic only to chocolate", "[59cf4e49-06ea-4139-a2c1-d7aad28f8cbc]") { + REQUIRE(true == allergies::allergy_test(32).is_allergic_to("chocolate")); } -TEST_CASE("allergic_to_lots_of_stuff") -{ - allergies::allergy_test score(248); - const std::unordered_set lots_of_stuff = {"strawberries", "tomatoes", "chocolate", "pollen", "cats"}; +TEST_CASE("testing for chocolate allergy -> allergic to chocolate and something else", "[b0a7c07b-2db7-4f73-a180-565e07040ef1]") { + REQUIRE(true == allergies::allergy_test(112).is_allergic_to("chocolate")); +} - REQUIRE(lots_of_stuff == score.get_allergies()); +TEST_CASE("testing for chocolate allergy -> allergic to something, but not chocolate", "[f5506893-f1ae-482a-b516-7532ba5ca9d2]") { + REQUIRE(false == allergies::allergy_test(80).is_allergic_to("chocolate")); } -TEST_CASE("allergic_to_everything") -{ - allergies::allergy_test score(255); - const std::unordered_set everything = {"eggs", "peanuts", "shellfish", "strawberries", - "tomatoes", "chocolate", "pollen", "cats"}; +TEST_CASE("testing for chocolate allergy -> allergic to everything", "[02debb3d-d7e2-4376-a26b-3c974b6595c6]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("chocolate")); +} - REQUIRE(everything == score.get_allergies()); +TEST_CASE("testing for pollen allergy -> not allergic to anything", "[17f4a42b-c91e-41b8-8a76-4797886c2d96]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("pollen")); } -TEST_CASE("ignore_non_allergen_score_parts") -{ - allergies::allergy_test score(509); - const std::unordered_set non_allergen = {"eggs", "shellfish", "strawberries", "tomatoes", - "chocolate", "pollen", "cats"}; +TEST_CASE("testing for pollen allergy -> allergic only to pollen", "[7696eba7-1837-4488-882a-14b7b4e3e399]") { + REQUIRE(true == allergies::allergy_test(64).is_allergic_to("pollen")); +} + +TEST_CASE("testing for pollen allergy -> allergic to pollen and something else", "[9a49aec5-fa1f-405d-889e-4dfc420db2b6]") { + REQUIRE(true == allergies::allergy_test(224).is_allergic_to("pollen")); +} + +TEST_CASE("testing for pollen allergy -> allergic to something, but not pollen", "[3cb8e79f-d108-4712-b620-aa146b1954a9]") { + REQUIRE(false == allergies::allergy_test(160).is_allergic_to("pollen")); +} + +TEST_CASE("testing for pollen allergy -> allergic to everything", "[1dc3fe57-7c68-4043-9d51-5457128744b2]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("pollen")); +} - REQUIRE(non_allergen == score.get_allergies()); +TEST_CASE("testing for cats allergy -> not allergic to anything", "[d3f523d6-3d50-419b-a222-d4dfd62ce314]") { + REQUIRE(false == allergies::allergy_test(0).is_allergic_to("cats")); } + +TEST_CASE("testing for cats allergy -> allergic only to cats", "[eba541c3-c886-42d3-baef-c048cb7fcd8f]") { + REQUIRE(true == allergies::allergy_test(128).is_allergic_to("cats")); +} + +TEST_CASE("testing for cats allergy -> allergic to cats and something else", "[ba718376-26e0-40b7-bbbe-060287637ea5]") { + REQUIRE(true == allergies::allergy_test(192).is_allergic_to("cats")); +} + +TEST_CASE("testing for cats allergy -> allergic to something, but not cats", "[3c6dbf4a-5277-436f-8b88-15a206f2d6c4]") { + REQUIRE(false == allergies::allergy_test(64).is_allergic_to("cats")); +} + +TEST_CASE("testing for cats allergy -> allergic to everything", "[1faabb05-2b98-4995-9046-d83e4a48a7c1]") { + REQUIRE(true == allergies::allergy_test(255).is_allergic_to("cats")); +} + +TEST_CASE("list when: -> no allergies", "[f9c1b8e7-7dc5-4887-aa93-cebdcc29dd8f]") { + std::unordered_set expected ={}; + REQUIRE(expected == allergies::allergy_test(0).get_allergies()); +} + +TEST_CASE("list when: -> just eggs", "[9e1a4364-09a6-4d94-990f-541a94a4c1e8]") { + std::unordered_set expected ={"eggs"}; + REQUIRE(expected == allergies::allergy_test(1).get_allergies()); +} + +TEST_CASE("list when: -> just peanuts", "[8851c973-805e-4283-9e01-d0c0da0e4695]") { + std::unordered_set expected ={"peanuts"}; + REQUIRE(expected == allergies::allergy_test(2).get_allergies()); +} + +TEST_CASE("list when: -> just strawberries", "[2c8943cb-005e-435f-ae11-3e8fb558ea98]") { + std::unordered_set expected ={"strawberries"}; + REQUIRE(expected == allergies::allergy_test(8).get_allergies()); +} + +TEST_CASE("list when: -> eggs and peanuts", "[6fa95d26-044c-48a9-8a7b-9ee46ec32c5c]") { + std::unordered_set expected ={"eggs", "peanuts"}; + REQUIRE(expected == allergies::allergy_test(3).get_allergies()); +} + +TEST_CASE("list when: -> more than eggs but not peanuts", "[19890e22-f63f-4c5c-a9fb-fb6eacddfe8e]") { + std::unordered_set expected ={"eggs", "shellfish"}; + REQUIRE(expected == allergies::allergy_test(5).get_allergies()); +} + +TEST_CASE("list when: -> lots of stuff", "[4b68f470-067c-44e4-889f-c9fe28917d2f]") { + std::unordered_set expected ={"strawberries", "tomatoes", "chocolate", "pollen", "cats"}; + REQUIRE(expected == allergies::allergy_test(248).get_allergies()); +} + +TEST_CASE("list when: -> everything", "[0881b7c5-9efa-4530-91bd-68370d054bc7]") { + std::unordered_set expected ={"eggs", "peanuts", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"}; + REQUIRE(expected == allergies::allergy_test(255).get_allergies()); +} + +TEST_CASE("list when: -> no allergen score parts", "[12ce86de-b347-42a0-ab7c-2e0570f0c65b]") { + std::unordered_set expected ={"eggs", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"}; + REQUIRE(expected == allergies::allergy_test(509).get_allergies()); +} + +TEST_CASE("list when: -> no allergen score parts without highest valid score", "[93c2df3e-4f55-4fed-8116-7513092819cd]") { + std::unordered_set expected ={"eggs"}; + REQUIRE(expected == allergies::allergy_test(257).get_allergies()); +} + #endif