-
-
Notifications
You must be signed in to change notification settings - Fork 231
Added "baffling-birthdays" exercise #977
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
base: main
Are you sure you want to change the base?
Added "baffling-birthdays" exercise #977
Conversation
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
#endif | ||
|
||
TEST_CASE("one_birthdate", "[716dcc2b-8fe4-4fc9-8c48-cbe70d8e6b67]") { | ||
std::vector<std::string> birthdates{"2000-01-01"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would find it nicer if we had a dedicated struct Date
(or similar) for a date as opposed to a plain string. Either define your own or use the one from Boost, which we have available in the test runner. Maybe we could even move the track officially to C++20 now? Then we could use std::chrono::year_month_day
TEST_CASE("two_birthdates_with_same_year_month_and_day", | ||
"[f7b3eb26-bcfc-4a1e-a2de-af07afc33f45]") { | ||
std::vector<std::string> birthdates{"2000-01-01", "2000-01-01"}; | ||
REQUIRE(baffling_birthdays::shared_birthday(birthdates) == true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REQUIRE(baffling_birthdays::shared_birthday(birthdates) == true); | |
REQUIRE(baffling_birthdays::shared_birthday(birthdates)); |
TEST_CASE("two_birthdates_with_same_year_and_month_but_different_day", | ||
"[7193409a-6e16-4bcb-b4cc-9ffe55f79b25]") { | ||
std::vector<std::string> birthdates{"2012-05-09", "2012-05-17"}; | ||
REQUIRE(baffling_birthdays::shared_birthday(birthdates) == false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REQUIRE(baffling_birthdays::shared_birthday(birthdates) == false); | |
REQUIRE_FALSE(baffling_birthdays::shared_birthday(birthdates)); |
Hey,
I added the baffling-birthdays exercise as mentioned in #976
Kind regards,
Marcel