mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:37:34 +00:00
Tests: Move AK tests to Tests/AK
This commit is contained in:
parent
fd0dbd1ebf
commit
67322b0702
64 changed files with 1 additions and 2 deletions
23
Tests/AK/TestAnyOf.cpp
Normal file
23
Tests/AK/TestAnyOf.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/AnyOf.h>
|
||||
#include <AK/Array.h>
|
||||
|
||||
TEST_CASE(should_determine_if_predicate_applies_to_any_element_in_container)
|
||||
{
|
||||
constexpr Array<int, 10> a { 1 };
|
||||
|
||||
static_assert(any_of(a.begin(), a.end(), [](auto elem) { return elem == 0; }));
|
||||
static_assert(any_of(a.begin(), a.end(), [](auto elem) { return elem == 1; }));
|
||||
static_assert(!any_of(a.begin(), a.end(), [](auto elem) { return elem == 2; }));
|
||||
|
||||
EXPECT(any_of(a.begin(), a.end(), [](auto elem) { return elem == 0; }));
|
||||
EXPECT(any_of(a.begin(), a.end(), [](auto elem) { return elem == 1; }));
|
||||
EXPECT(!any_of(a.begin(), a.end(), [](auto elem) { return elem == 2; }));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue