<commit_before>#include "allergies.h"
#include "test/catch.hpp"

#include <string>
#include <unordered_set>

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"));
}

#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("allergic_to_peanuts")
{
    allergies::allergy_test score(2);
   
    REQUIRE(true == score.is_allergic_to("peanuts"));
}

TEST_CASE("allergic_to_shellfish")
{
    allergies::allergy_test score(4);
   
    REQUIRE(true == score.is_allergic_to("shellfish"));
}

TEST_CASE("allergic_to_strawberries")
{
    allergies::allergy_test score(8);
   
    REQUIRE(true == score.is_allergic_to("strawberries"));
}

TEST_CASE("allergic_to_tomatoes")
{
    allergies::allergy_test score(16);
   
    REQUIRE(true == score.is_allergic_to("tomatoes"));
}

TEST_CASE("allergic_to_chocolate")
{
    allergies::allergy_test score(32);
   
    REQUIRE(true == score.is_allergic_to("chocolate"));
}

TEST_CASE("allergic_to_pollen")
{
    allergies::allergy_test score(64);
   
    REQUIRE(true == score.is_allergic_to("pollen"));
}

TEST_CASE("allergic_to_cats")
{
    allergies::allergy_test score(128);
   
    REQUIRE(true == score.is_allergic_to("cats"));
}

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("allergic_to_nothing")
{
    allergies::allergy_test score(0);
    const std::unordered_set<std::string> no_allergies;

    REQUIRE(no_allergies == score.get_allergies());
}

TEST_CASE("allergic_to_only_peanuts")
{<commit_msg>Fixing default init in allergies.<commit_after>#include "allergies.h"
#include "test/catch.hpp"

#include <string>
#include <unordered_set>

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"));
}

#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("allergic_to_peanuts")
{
    allergies::allergy_test score(2);
   
    REQUIRE(true == score.is_allergic_to("peanuts"));
}

TEST_CASE("allergic_to_shellfish")
{
    allergies::allergy_test score(4);
   
    REQUIRE(true == score.is_allergic_to("shellfish"));
}

TEST_CASE("allergic_to_strawberries")
{
    allergies::allergy_test score(8);
   
    REQUIRE(true == score.is_allergic_to("strawberries"));
}

TEST_CASE("allergic_to_tomatoes")
{
    allergies::allergy_test score(16);
   
    REQUIRE(true == score.is_allergic_to("tomatoes"));
}

TEST_CASE("allergic_to_chocolate")
{
    allergies::allergy_test score(32);
   
    REQUIRE(true == score.is_allergic_to("chocolate"));
}

TEST_CASE("allergic_to_pollen")
{
    allergies::allergy_test score(64);
   
    REQUIRE(true == score.is_allergic_to("pollen"));
}

TEST_CASE("allergic_to_cats")
{
    allergies::allergy_test score(128);
   
    REQUIRE(true == score.is_allergic_to("cats"));
}

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("allergic_to_nothing")
{
    allergies::allergy_test score(0);
    const std::unordered_set<std::string> no_allergies{};

    REQUIRE(no_allergies == score.get_allergies());
}

TEST_CASE("allergic_to_only_peanuts")
{
{'fraction_non_alphanumeric': 0.15251256281407036, 'fraction_numerical': 0.008040201005025126, 'mean_word_length': 5.679530201342282, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6186563', 'n_tokens_mistral': 1664, 'n_tokens_neox': 1563, 'n_words': 158}