mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +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
21
Tests/AK/TestAllOf.cpp
Normal file
21
Tests/AK/TestAllOf.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (c) 2020, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/AllOf.h>
|
||||
#include <AK/Array.h>
|
||||
|
||||
TEST_CASE(should_determine_if_predicate_applies_to_all_elements_in_container)
|
||||
{
|
||||
constexpr Array<int, 10> a {};
|
||||
|
||||
static_assert(all_of(a.begin(), a.end(), [](auto elem) { return elem == 0; }));
|
||||
static_assert(!all_of(a.begin(), a.end(), [](auto elem) { return elem == 1; }));
|
||||
|
||||
EXPECT(all_of(a.begin(), a.end(), [](auto elem) { return elem == 0; }));
|
||||
EXPECT(!all_of(a.begin(), a.end(), [](auto elem) { return elem == 1; }));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue