Sequoia
Loading...
Searching...
No Matches
LinearSequenceTestingUtilities.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2020. //
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
13
15
16namespace sequoia::testing
17{
18 template<class T, std::integral Index>
19 struct value_tester<maths::linear_sequence<T, Index>>
20 {
22
23 template<test_mode Mode>
24 static void test(equality_check_t, test_logger<Mode>& logger, const type& sequence, const type& prediction)
25 {
26 check(equality, "Start", logger, sequence.start(), prediction.start());
27 check(equality, "Step", logger, sequence.step(), prediction.step());
28 }
29
30 template<test_mode Mode>
31 static void test(equivalence_check_t, test_logger<Mode>& logger, const type& sequence, const std::pair<T, T>& prediction)
32 {
33 check(equality, "Start wrong", logger, sequence.start(), prediction.first);
34 check(equality, "Step wrong", logger, sequence.step(), prediction.second);
35 }
36 };
37}
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
Classes implementing the concept of a linear sequence.
Utilities for checking regular semantics.
Definition: LinearSequence.hpp:18
Definition: TestLogger.hpp:183
Definition: FreeCheckers.hpp:82
Definition: FreeCheckers.hpp:87
class template, specializations of which implement various comparisons for the specified type.
Definition: FreeCheckers.hpp:78