Skip to content

Commit

Permalink
Fixed find_if_not test name and added runtime test
Browse files Browse the repository at this point in the history
  • Loading branch information
nwad123 committed Nov 5, 2024
1 parent f14079a commit 2e295da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/test_find_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ static_assert(test_find_if());

TEST_CASE("find_if")
{
REQUIRE(test_find_if());

{
std::vector<int> vec {1, 2, 3, 4, 5};
auto is_greater_than_3 = [](int x) { return x > 3; };
Expand Down
6 changes: 4 additions & 2 deletions test/test_find_if_not.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static_assert(not std::invocable<find_if_not_fn, int[10], S_comp>);
using not_a_predicate = auto(int x) -> S;
static_assert(not std::invocable<find_if_not_fn, int[10], not_a_predicate>);

constexpr bool test_find_if()
constexpr bool test_find_if_not()
{
{
int const ints[] = {0, 1, 2, 3, 4, 5};
Expand Down Expand Up @@ -99,12 +99,14 @@ constexpr bool test_find_if()

return true;
}
static_assert(test_find_if());
static_assert(test_find_if_not());

} // namespace

TEST_CASE("find_if_not")
{
REQUIRE(test_find_if_not());

{
std::vector<int> vec {1, 2, 3, 4, 5};
auto is_odd = [](int x) { return x % 2 == 1; };
Expand Down

0 comments on commit 2e295da

Please sign in to comment.