|
Sequoia
|
Useful specializations for the class template value_tester. More...
#include "sequoia/TestFramework/FreeCheckers.hpp"#include "sequoia/TestFramework/FileEditors.hpp"#include "sequoia/TestFramework/FileSystemUtilities.hpp"#include "sequoia/Core/Object/Factory.hpp"#include "sequoia/FileSystem/FileSystem.hpp"#include "sequoia/Streaming/Streaming.hpp"#include <any>#include <array>#include <format>#include <functional>#include <memory>#include <optional>#include <tuple>#include <variant>Go to the source code of this file.
Functions | |
| std::string | sequoia::testing::path_check_preamble (std::string_view prefix, const std::filesystem::path &path, const std::filesystem::path &prediction) |
Variables | |
| template<class T > | |
| constexpr bool | sequoia::testing::is_file_comparer_v |
Useful specializations for the class template value_tester.
The specializations in this header are for various types defined in std. Internally, check(equality,...) / check(equivalence,...) are used meaning that there will be automatic, recursive dispatch to other specializations of value_tester, if appropriate. For example, consider two instances of std::pair<T, U>, x and y. The utilities in this header means the call
check(equality, "descripion", logger, x, y);
will automatically call
check(equality, "automatically enhanced desciption", logger, x.first, y,first)
and similarly for the second element. In turn, this nested check(equality, ...) will use a specialization of the value_tester for T, should it exist. As usual, if the specialization for T does not exist, but T may be interpreted as a range holding a type V, then everything will simply work, provided either that there exists a specialization of the value_tester for V or V is serializable.
However, all of this begs the question as to what happens in the above example if one or both of U and T do not support equality checking, but rather only offer equivalence or weak_equivalence. If both types have the same characteristics, then the top level call can be made using the appropriate tag. However, if they are different then instead clients should use
check(with_best_available, "descripion", logger, x, y);
This uses static reflection to choose the strongest check available for each of the nested types.
|
inlineconstexpr |