Sequoia
Loading...
Searching...
No Matches
MemOrderedTupleTestingUtilities.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2025. //
3// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. //
4// (See accompanying file LICENSE.md or copy at //
5// https://www.gnu.org/licenses/gpl-3.0.en.html) //
7
8#pragma once
9
14
15namespace sequoia::testing
16{
17 template<class... Ts>
19 {
20 using type = mem_ordered_tuple<Ts...>;
21
22 template<test_mode Mode>
23 static void test(equality_check_t, test_logger<Mode>& logger, const type& actual, const type& prediction)
24 {
25 [&]<std::size_t... Is> (std::index_sequence<Is...>) {
26 (check(equality, std::format("Element {}", Is), logger, get<Is>(actual), get<Is>(prediction)), ...);
27 }(std::make_index_sequence<sizeof...(Ts)>{});
28 }
29
30 template<test_mode Mode>
31 static void test(equivalence_check_t, test_logger<Mode>& logger, const type& actual, const std::tuple<Ts...>& prediction)
32 {
33 [&]<std::size_t... Is> (std::index_sequence<Is...>) {
34 (check(equality, std::format("Element {}", Is), logger, get<Is>(actual), std::get<Is>(prediction)), ...);
35 }(std::make_index_sequence<sizeof...(Ts)>{});
36 }
37 };
38}
bool check(CheckType flavour, std::string description, test_logger< Mode > &logger, Iter first, Sentinel last, PredictionIter predictionFirst, PredictionSentinel predictionLast, tutor< Advisor > advisor={})
The workhorse for comparing the contents of ranges.
Definition: FreeCheckers.hpp:377
Utilities for checking regular semantics.
Definition: TestLogger.hpp:183
Definition: MemOrderedTuple.hpp:62
Definition: FreeCheckers.hpp:82
Definition: FreeCheckers.hpp:87
class template, specializations of which implement various comparisons for the specified type.
Definition: FreeCheckers.hpp:78