diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..5471aa9
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,62 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ build-gcc16:
+ name: GCC 16 / C++26 / ${{ matrix.config }}
+ runs-on: ubuntu-24.04
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - default
+ - werror
+ - sanitizers
+ include:
+ - config: default
+ cmake_args: ""
+ - config: werror
+ cmake_args: "-DVOID_WARNINGS_AS_ERRORS=ON"
+ - config: sanitizers
+ cmake_args: "-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON"
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install GCC 16 + tooling
+ run: |
+ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+ sudo apt-get update
+ sudo apt-get install -y g++-16 ninja-build cmake libboost-all-dev
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-16 100
+
+ - name: Cache FetchContent dependencies
+ uses: actions/cache@v4
+ with:
+ path: build/_deps
+ key: ${{ runner.os }}-fetchcontent-boost-${{ hashFiles('cmake/Dependencies.cmake') }}
+
+ - name: Configure
+ run: |
+ cmake -B build -S . -G Ninja \
+ -DCMAKE_CXX_COMPILER=g++-16 \
+ -DCMAKE_BUILD_TYPE=Debug \
+ ${{ matrix.cmake_args }}
+
+ - name: Build
+ run: cmake --build build
+
+ - name: Test
+ run: ctest --test-dir build --output-on-failure
+
+ # NOTE: a Clang job is intentionally absent. The library targets C++26
+ # with std::meta reflection (-freflection), which Clang does not yet
+ # support. The Repr.hpp helper degrades gracefully via __has_include,
+ # but CMakeLists.txt currently hard-pins CMAKE_CXX_STANDARD to 26.
+ # Add a Clang job once Clang ships P2996 reflection (tracked in the
+ # roadmap as Phase 2 follow-up).
diff --git a/.gitignore b/.gitignore
index 7dde1b5..2b0ac31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
build
+build*
CLAUDE.md
diff --git a/CLAUDE.md b/CLAUDE.md
index 20fe135..d885721 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -4,11 +4,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Build
-Requires CMake 4.0+ and a C++23 compiler (clang++ is the default in the configure command below).
+Requires CMake 4.0+ and a C++26 compiler. GCC 16+ is the default — it ships
+the experimental `-freflection` flag and the `` header that several
+modules use. Clang is supported but currently lacks P2996 reflection, so
+modules that use it stay reflection-free behind `__has_include()`.
```bash
-# Configure (clang++, Ninja, Debug)
-cmake -B build -S . -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug
+# Configure (g++, Ninja, Debug)
+cmake -B build -S . -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug
# Build
cmake --build build
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 869189a..b386633 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 4.0.0)
project(Void VERSION 1.0.0 LANGUAGES CXX)
option(VOID_ENABLE_TESTING "Build the test suite" ON)
-set(CMAKE_CXX_STANDARD 23)
+option(VOID_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
+option(VOID_ENABLE_ASAN "Enable AddressSanitizer (Clang/GCC)" OFF)
+option(VOID_ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (Clang/GCC)" OFF)
+option(VOID_ENABLE_COVERAGE "Enable code coverage instrumentation" OFF)
+set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(GNUInstallDirs)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..92316ae
--- /dev/null
+++ b/README.md
@@ -0,0 +1,85 @@
+# VoidLibrary
+
+A modular C++26 shared library. Each module is an independently installable
+CMake target under the `Void::` namespace; the build system auto-discovers
+modules under `src/` and links them together.
+
+## Build
+
+Requires CMake 4.0+ and a C++26 compiler. GCC 16+ is the default — it ships
+experimental P2996 reflection (`-freflection`, `` header) that several
+modules opt into.
+
+```bash
+# Configure (g++, Ninja, Debug)
+cmake -B build -S . -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug
+
+# Build
+cmake --build build
+
+# Run all tests
+ctest --test-dir build
+
+# Run a single standalone test binary directly
+./build/tests/test_standalone_Logging_FileLogger
+```
+
+### Optional build flags
+
+| Flag | Default | Effect |
+|----------------------------|---------|------------------------------------------------------------------------|
+| `VOID_ENABLE_TESTING` | `ON` | Build the test suite under `tests/`. |
+| `VOID_WARNINGS_AS_ERRORS` | `OFF` | Adds `-Wall -Wextra -Wpedantic -Werror` (GCC/Clang) or `/W4 /WX` (MSVC). |
+| `VOID_ENABLE_ASAN` | `OFF` | Adds `-fsanitize=address` to compile and link. |
+| `VOID_ENABLE_UBSAN` | `OFF` | Adds `-fsanitize=undefined` to compile and link. |
+| `VOID_ENABLE_COVERAGE` | `OFF` | Adds `--coverage` (GCC) or `-fprofile-instr-generate -fcoverage-mapping` (Clang). After `ctest`, run `gcovr -r . build` for a report. |
+
+```bash
+cmake -B build-asan -S . -G Ninja -DCMAKE_CXX_COMPILER=g++ \
+ -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON \
+ -DVOID_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE=Debug
+cmake --build build-asan
+ctest --test-dir build-asan
+```
+
+Format code with `clang-format -i `.
+
+## Modules
+
+| Module | Namespace | Description |
+|---------------|-----------------------|-----------------------------------------------------------------------------|
+| `Logging` | `Void::Logging` | Thread-safe `Logger` ABC with buffering, scopes, presets; ships `FileLogger` and `ConsoleLogger` sinks. |
+| `Testing` | `Void::Testing` | Self-registering test framework with fixtures, tags, JUnit/console reporters, signal-handler crash capture. |
+| `TestingMock` | `Void::TestingMock` | Header-only mock framework: `MockFunction`, `Mock` CRTP base, matchers (`Eq`/`_`/`Lt`/`Le`/`Gt`/`Ge`/`Range`/`Pred`/`StartsWith`/`Contains`), move-only actions. |
+| `Stacktrace` | `Void::Stacktrace` | Stack capture + source-snippet rendering via Boost.Stacktrace; ANSI color helpers. |
+| `Result` | `Void::Result` | Header-only `Result = std::expected` plus `Error` with cause-chain context, `with_context()` helper, reflection-based struct `repr` (C++26 ``). |
+| `FileSystem` | `Void::FileSystem` | Header-only path utilities returning `Result`: `read_file`, `write_file`, `atomic_write`, `ensure_directory`, `remove_path`, RAII `TempDir`. |
+
+## Adding a module
+
+Create `src//` and populate it with sources/headers — the build
+picks it up automatically. Public headers go in
+`include/Void//*.hpp`. For special dependency wiring drop a
+`module.cmake` in the source directory; see `cmake/module.cmake.template`
+for the shape and `cmake/Module.cmake` for the full `void_add_module`
+contract (`INTERNAL_DEPS`, `EXTERNAL_DEPS`, `OPTIONAL_DEPS`,
+`DEPS_WIN32`/`DEPS_UNIX`, `OPTIONS_WIN32`/`OPTIONS_UNIX`).
+
+## Using as a dependency
+
+```cmake
+find_package(Void REQUIRED)
+target_link_libraries(myapp PRIVATE Void::Logging Void::Stacktrace)
+```
+
+`find_package(Void)` exposes every installed module under the `Void::`
+namespace and auto-loads the test scanner so downstream projects can use
+`void_add_tests()` for free.
+
+## Writing tests
+
+Tests are free functions or methods on a `Void::Testing::Fixture` subclass
+returning `Void::Testing::Test` (or `Void::Testing::DisabledTest`).
+Registration is automatic — the CMake test scanner parses each `.cpp` at
+configure time and generates the registration shim. See `CLAUDE.md` for the
+comment-metadata syntax (`// @tag`, `// @skip`).
diff --git a/cmake/Module.cmake b/cmake/Module.cmake
index 00b37f6..d7e1119 100644
--- a/cmake/Module.cmake
+++ b/cmake/Module.cmake
@@ -20,7 +20,7 @@ function(void_add_module MODULE_NAME)
set(LIB_TYPE "INTERFACE")
set(SCOPE "INTERFACE")
add_library(${TGT} INTERFACE)
- target_compile_features(${TGT} INTERFACE cxx_std_23)
+ target_compile_features(${TGT} INTERFACE cxx_std_26)
else()
set(LIB_TYPE "SHARED")
set(SCOPE "PUBLIC")
@@ -30,7 +30,7 @@ function(void_add_module MODULE_NAME)
add_library(${TGT} SHARED)
endif()
target_sources(${TGT} PRIVATE ${SRC})
- target_compile_features(${TGT} PUBLIC cxx_std_23)
+ target_compile_features(${TGT} PUBLIC cxx_std_26)
endif()
add_library(${ALIAS} ALIAS ${TGT})
@@ -73,14 +73,58 @@ function(void_add_module MODULE_NAME)
foreach(_opt IN LISTS ARG_OPTIONS_UNIX)
target_compile_options(${TGT} PRIVATE "$<$>:${_opt}>")
endforeach()
+
+ if(VOID_WARNINGS_AS_ERRORS)
+ target_compile_options(${TGT} PRIVATE
+ "$<$:-Wall;-Wextra;-Wpedantic;-Werror;-Wno-missing-field-initializers>"
+ "$<$:-Wno-missing-designated-field-initializers>"
+ "$<$:/W4;/WX>"
+ )
+ endif()
+
+ if(VOID_ENABLE_ASAN)
+ target_compile_options(${TGT} PUBLIC
+ "$<$:-fsanitize=address;-fno-omit-frame-pointer>"
+ )
+ target_link_options(${TGT} PUBLIC
+ "$<$:-fsanitize=address>"
+ )
+ endif()
+
+ if(VOID_ENABLE_UBSAN)
+ target_compile_options(${TGT} PUBLIC
+ "$<$:-fsanitize=undefined>"
+ )
+ target_link_options(${TGT} PUBLIC
+ "$<$:-fsanitize=undefined>"
+ )
+ endif()
+
+ if(VOID_ENABLE_COVERAGE)
+ target_compile_options(${TGT} PUBLIC
+ "$<$:--coverage;-fprofile-update=atomic>"
+ "$<$:-fprofile-instr-generate;-fcoverage-mapping>"
+ )
+ target_link_options(${TGT} PUBLIC
+ "$<$:--coverage>"
+ "$<$:-fprofile-instr-generate>"
+ )
+ endif()
endif()
set_target_properties(${TGT} PROPERTIES
- CXX_STANDARD 23
+ CXX_STANDARD 26
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
EXPORT_NAME ${MODULE_NAME}
)
+
+ # GCC 16+ exposes experimental C++26 reflection (P2996) via -freflection.
+ # Apply it to every module unconditionally so any module is free to use
+ # ^^T / std::meta::* without per-module wiring.
+ if(SRC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
+ target_compile_options(${TGT} PUBLIC -freflection)
+ endif()
target_sources(${TGT} ${SCOPE} FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" FILES ${HDR})
target_include_directories(${TGT} ${SCOPE}
$
diff --git a/include/Void/FileSystem/Path.hpp b/include/Void/FileSystem/Path.hpp
new file mode 100644
index 0000000..c65c196
--- /dev/null
+++ b/include/Void/FileSystem/Path.hpp
@@ -0,0 +1,126 @@
+#pragma once
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace Void::FileSystem
+{
+ /// Read the entire contents of a file as a string.
+ ///
+ /// Failure modes wrapped in `Result`:
+ /// - File does not exist
+ /// - File cannot be opened (permissions, etc.)
+ /// - I/O error during read
+ [[nodiscard]] inline Void::Result::Result
+ read_file(const std::filesystem::path& path)
+ {
+ std::ifstream f{path, std::ios::binary};
+ if (!f.is_open()) {
+ return Void::Result::fail(std::format(
+ "FileSystem::read_file: cannot open '{}'", path.string()));
+ }
+ std::string content{std::istreambuf_iterator(f),
+ std::istreambuf_iterator()};
+ if (f.bad()) {
+ return Void::Result::fail(
+ std::format("FileSystem::read_file: I/O error reading '{}'",
+ path.string()));
+ }
+ return Void::Result::ok(std::move(content));
+ }
+
+ /// Write `content` to `path`, overwriting any existing file.
+ ///
+ /// This is NOT crash-safe — a process killed mid-write may leave a
+ /// truncated file. Use `atomic_write` when you need durability.
+ [[nodiscard]] inline Void::Result::Result
+ write_file(const std::filesystem::path& path, std::string_view content)
+ {
+ std::ofstream f{path, std::ios::binary | std::ios::trunc};
+ if (!f.is_open()) {
+ return Void::Result::fail(std::format(
+ "FileSystem::write_file: cannot open '{}'", path.string()));
+ }
+ f.write(content.data(), static_cast(content.size()));
+ f.flush();
+ if (!f.good()) {
+ return Void::Result::fail(
+ std::format("FileSystem::write_file: I/O error writing '{}'",
+ path.string()));
+ }
+ return {};
+ }
+
+ /// Crash-safe write: stage `content` in a sibling `.tmp` file, then
+ /// atomically rename onto `path`. The rename is atomic on POSIX
+ /// within the same filesystem; std::filesystem::rename uses the
+ /// platform-appropriate primitive (`ReplaceFileW` on Windows).
+ ///
+ /// Note: this does NOT fsync the staged file before rename. A
+ /// process or kernel crash between write and rename may leave the
+ /// `.tmp` file behind, but the original `path` is never corrupted.
+ [[nodiscard]] inline Void::Result::Result
+ atomic_write(const std::filesystem::path& path,
+ std::string_view content)
+ {
+ auto staging = path;
+ staging += ".tmp";
+ if (auto r = write_file(staging, content); !r) {
+ return r;
+ }
+ std::error_code ec;
+ std::filesystem::rename(staging, path, ec);
+ if (ec) {
+ std::error_code ignore;
+ std::filesystem::remove(staging, ignore);
+ return Void::Result::fail(std::format(
+ "FileSystem::atomic_write: rename failed for '{}': {}",
+ path.string(), ec.message()));
+ }
+ return {};
+ }
+
+ /// Create `path` as a directory, including any missing parents.
+ /// Succeeds (no-op) if `path` already exists as a directory.
+ [[nodiscard]] inline Void::Result::Result
+ ensure_directory(const std::filesystem::path& path)
+ {
+ std::error_code ec;
+ if (std::filesystem::is_directory(path, ec)) {
+ return {};
+ }
+ std::filesystem::create_directories(path, ec);
+ if (ec) {
+ return Void::Result::fail(std::format(
+ "FileSystem::ensure_directory: cannot create '{}': {}",
+ path.string(), ec.message()));
+ }
+ return {};
+ }
+
+ /// Remove a file or directory (recursively for directories).
+ /// Succeeds (no-op) if the path doesn't exist.
+ [[nodiscard]] inline Void::Result::Result
+ remove_path(const std::filesystem::path& path)
+ {
+ std::error_code ec;
+ std::filesystem::remove_all(path, ec);
+ if (ec) {
+ return Void::Result::fail(
+ std::format("FileSystem::remove_path: cannot remove '{}': {}",
+ path.string(), ec.message()));
+ }
+ return {};
+ }
+
+} // namespace Void::FileSystem
diff --git a/include/Void/FileSystem/TempDir.hpp b/include/Void/FileSystem/TempDir.hpp
new file mode 100644
index 0000000..e2647db
--- /dev/null
+++ b/include/Void/FileSystem/TempDir.hpp
@@ -0,0 +1,122 @@
+#pragma once
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace Void::FileSystem
+{
+ /// RAII scoped directory under `std::filesystem::temp_directory_path()`.
+ ///
+ /// The directory is created with a unique name on construction and
+ /// recursively removed on destruction. Useful in tests that need a
+ /// scratch area without manual cleanup.
+ ///
+ /// Construction throws `std::system_error` if the directory cannot
+ /// be created. Use `TempDir::open(prefix)` for a non-throwing
+ /// `Result`-returning factory.
+ class TempDir
+ {
+ public:
+
+ explicit TempDir(std::string_view prefix = "void_test_")
+ : m_path(make_unique_dir(prefix))
+ {
+ }
+
+ ~TempDir() noexcept
+ {
+ if (!m_path.empty()) {
+ std::error_code ignore;
+ std::filesystem::remove_all(m_path, ignore);
+ }
+ }
+
+ TempDir(const TempDir&) = delete;
+ TempDir& operator=(const TempDir&) = delete;
+
+ TempDir(TempDir&& other) noexcept
+ : m_path(std::exchange(other.m_path, {}))
+ {
+ }
+
+ TempDir& operator=(TempDir&& other) noexcept
+ {
+ if (this != &other) {
+ if (!m_path.empty()) {
+ std::error_code ignore;
+ std::filesystem::remove_all(m_path, ignore);
+ }
+ m_path = std::exchange(other.m_path, {});
+ }
+ return *this;
+ }
+
+ [[nodiscard]] const std::filesystem::path& path() const noexcept
+ {
+ return m_path;
+ }
+
+ /// Build a path inside the temp dir.
+ /// Example: `auto log_path = tmp / "test.log";`
+ [[nodiscard]] std::filesystem::path
+ operator/(std::string_view relative) const
+ {
+ return m_path / relative;
+ }
+
+ /// Non-throwing factory.
+ [[nodiscard]] static Void::Result::Result
+ open(std::string_view prefix = "void_test_")
+ {
+ try {
+ return Void::Result::ok(TempDir{prefix});
+ } catch (const std::exception& e) {
+ return Void::Result::fail(std::string{e.what()});
+ }
+ }
+
+ private:
+
+ std::filesystem::path m_path;
+
+ static std::filesystem::path
+ make_unique_dir(std::string_view prefix)
+ {
+ static std::atomic counter{0};
+ const auto base = std::filesystem::temp_directory_path();
+ for (int attempt = 0; attempt < 16; ++attempt) {
+ const auto seed =
+ static_cast(
+ std::chrono::steady_clock::now()
+ .time_since_epoch()
+ .count()) ^
+ (counter.fetch_add(1, std::memory_order_relaxed)
+ << 16) ^
+ static_cast(std::hash{}(
+ std::this_thread::get_id()));
+ auto candidate =
+ base / std::format("{}{:016x}", prefix, seed);
+ std::error_code ec;
+ if (std::filesystem::create_directory(candidate, ec)) {
+ return candidate;
+ }
+ }
+ throw std::system_error(
+ std::make_error_code(std::errc::file_exists),
+ "TempDir: failed to create unique directory after 16 "
+ "attempts");
+ }
+ };
+
+} // namespace Void::FileSystem
diff --git a/include/Void/Logging/ConsoleLogger.hpp b/include/Void/Logging/ConsoleLogger.hpp
new file mode 100644
index 0000000..87f4051
--- /dev/null
+++ b/include/Void/Logging/ConsoleLogger.hpp
@@ -0,0 +1,45 @@
+#pragma once
+
+#include
+
+#include
+
+namespace Void::Logging
+{
+ /// Logger sink that writes formatted entries to a std::ostream.
+ ///
+ /// Defaults to Mode::Immediate (each entry written as soon as it is
+ /// submitted) and to std::cerr if no stream is supplied.
+ ///
+ /// When the Stacktrace module is present (VOID_HAS_STACKTRACE), each
+ /// level prefix is colorized via Void::Stacktrace::Color helpers and
+ /// honors Void::Stacktrace::Color::g_color_enabled. Without Stacktrace
+ /// the output is uncolored.
+ class ConsoleLogger final : public Logger
+ {
+ public:
+
+ explicit ConsoleLogger(std::ostream& out,
+ Mode mode = Mode::Immediate,
+ std::size_t capacity = 0);
+
+ /// Convenience constructor — writes to std::cerr in Immediate mode.
+ ConsoleLogger();
+
+ ~ConsoleLogger() noexcept override;
+
+ ConsoleLogger(const ConsoleLogger&) = delete;
+ ConsoleLogger& operator=(const ConsoleLogger&) = delete;
+ ConsoleLogger(ConsoleLogger&&) = delete;
+ ConsoleLogger& operator=(ConsoleLogger&&) = delete;
+
+ protected:
+
+ void write(const Entry& entry) override;
+
+ private:
+
+ std::ostream& m_out;
+ };
+
+} // namespace Void::Logging
diff --git a/include/Void/Logging/FileLogger.hpp b/include/Void/Logging/FileLogger.hpp
new file mode 100644
index 0000000..78121ce
--- /dev/null
+++ b/include/Void/Logging/FileLogger.hpp
@@ -0,0 +1,61 @@
+#pragma once
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+namespace Void::Logging
+{
+ /// Logger sink that appends formatted entries to a file on disk.
+ ///
+ /// Defaults to Mode::Buffered with capacity 64 — entries are batched
+ /// via on_flush() and written using std::ofstream::flush() at the end
+ /// of every batch. The destructor flushes any remaining entries.
+ ///
+ /// Two construction paths:
+ /// - `FileLogger::open(path)` returns
+ /// `Result, Error>` and never throws —
+ /// prefer this in code that already uses Void::Result for error
+ /// plumbing.
+ /// - The throwing constructor stays for callers that prefer
+ /// exceptions; it throws std::runtime_error if the path cannot
+ /// be opened for append.
+ class FileLogger final : public Logger
+ {
+ public:
+
+ explicit FileLogger(const std::filesystem::path& path,
+ Mode mode = Mode::Buffered,
+ std::size_t capacity = 64);
+
+ ~FileLogger() noexcept override;
+
+ FileLogger(const FileLogger&) = delete;
+ FileLogger& operator=(const FileLogger&) = delete;
+ FileLogger(FileLogger&&) = delete;
+ FileLogger& operator=(FileLogger&&) = delete;
+
+ /// Non-throwing factory. On failure returns
+ /// `Failure{Error{"FileLogger: cannot open ''"}}`.
+ [[nodiscard]] static Void::Result::
+ Result, Void::Result::Error>
+ open(const std::filesystem::path& path,
+ Mode mode = Mode::Buffered,
+ std::size_t capacity = 64);
+
+ protected:
+
+ void write(const Entry& entry) override;
+ void on_flush(std::span entries) override;
+
+ private:
+
+ std::ofstream m_file;
+ };
+
+} // namespace Void::Logging
diff --git a/include/Void/Result/Detail/Repr.hpp b/include/Void/Result/Detail/Repr.hpp
new file mode 100644
index 0000000..0dc2483
--- /dev/null
+++ b/include/Void/Result/Detail/Repr.hpp
@@ -0,0 +1,77 @@
+#pragma once
+
+#include
+#include
+#include
+#include
+
+#if __has_include() && defined(__cpp_consteval)
+#include
+#define VOID_RESULT_HAS_REFLECTION 1
+#endif
+
+namespace Void::Result::Detail
+{
+ /// Render a value for diagnostic / log output.
+ ///
+ /// Resolution order:
+ /// 1. If a `std::formatter` exists, use `std::format("{}", v)`.
+ /// 2. Otherwise, if `T` exposes a `.format()` method returning
+ /// something convertible to `std::string`, call it.
+ /// 3. Otherwise, if C++26 reflection is available, walk the
+ /// non-static data members of `T` and render
+ /// `Type{field1: value1, field2: value2}`.
+ /// 4. Otherwise, return `""`.
+ template [[nodiscard]] std::string repr(const T& value);
+
+ template
+ concept Formattable = std::formattable;
+
+ template
+ concept HasFormatMethod = requires(const T& v) {
+ { v.format() } -> std::convertible_to;
+ };
+
+#ifdef VOID_RESULT_HAS_REFLECTION
+ template [[nodiscard]] std::string reflect_struct(const T& obj)
+ {
+ std::string out;
+ out += std::meta::identifier_of(^^T);
+ out += '{';
+ static constexpr auto members =
+ std::define_static_array(std::meta::nonstatic_data_members_of(
+ ^^T, std::meta::access_context::unchecked()));
+ bool first = true;
+ template for (constexpr auto member : members)
+ {
+ if (!first) {
+ out += ", ";
+ }
+ out += std::meta::identifier_of(member);
+ out += ": ";
+ out += repr(obj.[:member:]);
+ first = false;
+ }
+ out += '}';
+ return out;
+ }
+#endif
+
+ template [[nodiscard]] std::string repr(const T& value)
+ {
+ if constexpr (Formattable) {
+ return std::format("{}", value);
+ } else if constexpr (HasFormatMethod) {
+ return std::string{value.format()};
+ }
+#ifdef VOID_RESULT_HAS_REFLECTION
+ else if constexpr (std::is_class_v || std::is_union_v) {
+ return reflect_struct(value);
+ }
+#endif
+ else {
+ return "";
+ }
+ }
+
+} // namespace Void::Result::Detail
diff --git a/include/Void/Result/Error.hpp b/include/Void/Result/Error.hpp
new file mode 100644
index 0000000..1dd84ba
--- /dev/null
+++ b/include/Void/Result/Error.hpp
@@ -0,0 +1,79 @@
+#pragma once
+
+#include
+#include
+#include
+#include
+
+namespace Void::Result
+{
+ /// Default error type for Void::Result::Result.
+ ///
+ /// An Error carries a free-form `message` and an optional chained
+ /// `cause`. New context layers can be added with `with_context()`,
+ /// which returns a new Error whose `cause` is the previous error —
+ /// useful for "loading config: parsing line 42: invalid number".
+ ///
+ /// Errors are cheap to copy (the cause chain is shared via
+ /// shared_ptr).
+ class Error
+ {
+ public:
+
+ Error() = default;
+
+ explicit Error(std::string message) noexcept
+ : m_message(std::move(message))
+ {
+ }
+
+ Error(std::string message, Error cause)
+ : m_message(std::move(message)),
+ m_cause(std::make_shared(std::move(cause)))
+ {
+ }
+
+ [[nodiscard]] const std::string& message() const noexcept
+ {
+ return m_message;
+ }
+
+ [[nodiscard]] const std::shared_ptr&
+ cause() const noexcept
+ {
+ return m_cause;
+ }
+
+ /// Returns a new Error whose message is `ctx` and whose cause
+ /// is *this.
+ [[nodiscard]] Error with_context(std::string ctx) const&
+ {
+ return Error{std::move(ctx), *this};
+ }
+
+ [[nodiscard]] Error with_context(std::string ctx) &&
+ {
+ return Error{std::move(ctx), std::move(*this)};
+ }
+
+ /// Render the full cause chain as
+ /// "outer\n caused by: middle\n caused by: inner"
+ [[nodiscard]] std::string format() const
+ {
+ std::string out = m_message;
+ const Error* cur = m_cause.get();
+ while (cur != nullptr) {
+ out += "\n caused by: ";
+ out += cur->m_message;
+ cur = cur->m_cause.get();
+ }
+ return out;
+ }
+
+ private:
+
+ std::string m_message;
+ std::shared_ptr m_cause;
+ };
+
+} // namespace Void::Result
diff --git a/include/Void/Result/Result.hpp b/include/Void/Result/Result.hpp
new file mode 100644
index 0000000..8f2b80b
--- /dev/null
+++ b/include/Void/Result/Result.hpp
@@ -0,0 +1,64 @@
+#pragma once
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+namespace Void::Result
+{
+ /// `Result` is a thin alias over `std::expected`.
+ ///
+ /// std::expected already provides every monadic operation we need
+ /// (`and_then`, `or_else`, `transform` (= map), `transform_error`
+ /// (= map_err), `value_or`). The wrappers in this module add
+ /// context-chain support (see `with_context` below) and a default
+ /// error type (`Void::Result::Error`).
+ template
+ using Result = std::expected;
+
+ /// Tag wrapper for failure construction. Shorthand for
+ /// `std::unexpected`.
+ template using Failure = std::unexpected;
+
+ /// Convenience factory for a successful Result.
+ template
+ [[nodiscard]] constexpr Result> ok(T&& value)
+ {
+ return Result>{std::forward(value)};
+ }
+
+ /// Convenience factory for a failed Result with the default Error type.
+ [[nodiscard]] inline Failure fail(std::string message)
+ {
+ return Failure{Error{std::move(message)}};
+ }
+
+ /// Convenience factory for a failed Result with an arbitrary E.
+ /// Constrained so string-like types resolve to the `std::string`
+ /// overload above (otherwise a literal `"..."` deduces E to a char
+ /// array).
+ template
+ requires(!std::convertible_to, std::string>)
+ [[nodiscard]] constexpr Failure> fail(E&& error)
+ {
+ return Failure>{std::forward(error)};
+ }
+
+ /// Add a context layer to a failed Result. On success, the result is
+ /// returned unchanged. Requires that `E` exposes a
+ /// `with_context(std::string) const&` method (the bundled `Error`
+ /// type does).
+ template
+ [[nodiscard]] Result with_context(Result r, std::string ctx)
+ {
+ if (r) {
+ return r;
+ }
+ return Failure{std::move(r).error().with_context(std::move(ctx))};
+ }
+
+} // namespace Void::Result
diff --git a/include/Void/Stacktrace/Stacktrace.hpp b/include/Void/Stacktrace/Stacktrace.hpp
index e708a82..0e64ac7 100644
--- a/include/Void/Stacktrace/Stacktrace.hpp
+++ b/include/Void/Stacktrace/Stacktrace.hpp
@@ -1,18 +1,31 @@
#pragma once
+#include
+#include
+#include
#include
#include
-#include
-namespace Void::Stacktrace {
-struct StackFrame {
- std::string function_name;
- std::string source_file;
- int source_line{0};
- std::string source_snippet;
-};
+namespace Void::Stacktrace
+{
+ struct StackFrame {
+ std::string function_name;
+ std::string source_file;
+ int source_line{0};
+ std::string source_snippet;
+ };
-std::vector capture_stacktrace(unsigned skip_frames = 0, unsigned max_frames = 32);
-std::string read_source_snippet(const std::string& file, int line, int context_lines = 3);
-std::string format_stacktrace(const std::vector& frames);
-void print_stacktrace(std::ostream& os, const std::vector& frames);
+ std::vector capture_stacktrace(unsigned skip_frames = 0,
+ unsigned max_frames = 32);
+
+ /// Read a snippet of source around `line`. On failure (file missing,
+ /// not readable, etc.) returns Failure instead of an empty
+ /// string — callers that want the silent fallback can still do
+ /// `read_source_snippet(...).value_or("")`.
+ Void::Result::Result
+ read_source_snippet(const std::string& file, int line,
+ int context_lines = 3);
+
+ std::string format_stacktrace(const std::vector& frames);
+ void print_stacktrace(std::ostream& os,
+ const std::vector& frames);
} // namespace Void::Stacktrace
diff --git a/include/Void/Testing/Assert.hpp b/include/Void/Testing/Assert.hpp
index b30f8c9..11b6bd2 100644
--- a/include/Void/Testing/Assert.hpp
+++ b/include/Void/Testing/Assert.hpp
@@ -1,82 +1,207 @@
#pragma once
+#include
#include
#include
+#include
+#include
#include
+#include
#include
#include
#include
-#include
-#include
-#include
#include
-namespace Void::Testing::Detail {
-struct TestContext {
- TestResult* current_result{nullptr};
- bool should_abort{false};
- void* fixture{nullptr};
- static TestContext& current() { thread_local TestContext ctx; return ctx; }
-};
+namespace Void::Testing::Detail
+{
+ struct TestContext {
+ TestResult* current_result{nullptr};
+ bool should_abort{false};
+ void* fixture{nullptr};
+ static TestContext& current()
+ {
+ thread_local TestContext ctx;
+ return ctx;
+ }
+ };
-template
-std::string repr(const T& val) {
- if constexpr (std::is_same_v, bool>) return val ? "true" : "false";
- else if constexpr (std::is_same_v, std::string> || std::is_same_v, std::string_view>) return std::format("\"{}\"", val);
- else if constexpr (std::is_null_pointer_v>) return "nullptr";
- else if constexpr (requires { std::format("{}", val); }) return std::format("{}", val);
- else return "";
-}
+ /// Render a value for assertion-failure messages. Special-cases `bool`,
+ /// strings, and `nullptr` for unambiguous output, then falls through to
+ /// Void::Result::Detail::repr — which uses std::format when available and
+ /// C++26 reflection otherwise to walk struct fields.
+ template std::string repr(const T& val)
+ {
+ if constexpr (std::is_same_v, bool>) {
+ return val ? "true" : "false";
+ } else if constexpr (std::is_same_v, std::string> ||
+ std::is_same_v,
+ std::string_view>) {
+ return std::format("\"{}\"", val);
+ } else if constexpr (std::is_null_pointer_v>) {
+ return "nullptr";
+ } else {
+ return Void::Result::Detail::repr(val);
+ }
+ }
-void handle_assertion(AssertionResult result);
+ void handle_assertion(AssertionResult result);
-struct RequireFailure : std::runtime_error {
- using std::runtime_error::runtime_error;
-};
+ struct RequireFailure : std::runtime_error {
+ using std::runtime_error::runtime_error;
+ };
} // namespace Void::Testing::Detail
-namespace Void::Testing {
+namespace Void::Testing
+{
-template requires std::convertible_to
-void expect(T&& condition, std::source_location loc = std::source_location::current()) {
- AssertionResult result; result.passed = static_cast(condition); result.kind = AssertKind::Expect; result.location = loc; result.expression = "expect(...)"; if (!result.passed) result.message = "expected condition to be true"; Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::convertible_to
+ void expect(T&& condition,
+ std::source_location loc = std::source_location::current())
+ {
+ AssertionResult result;
+ result.passed = static_cast(condition);
+ result.kind = AssertKind::Expect;
+ result.location = loc;
+ result.expression = "expect(...)";
+ if (!result.passed) {
+ result.message = "expected condition to be true";
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-template requires std::convertible_to
-void require(T&& condition, std::source_location loc = std::source_location::current()) {
- AssertionResult result; result.passed = static_cast(condition); result.kind = AssertKind::Require; result.location = loc; result.expression = "require(...)"; if (!result.passed) result.message = "required condition to be true"; Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::convertible_to
+ void require(T&& condition,
+ std::source_location loc = std::source_location::current())
+ {
+ AssertionResult result;
+ result.passed = static_cast(condition);
+ result.kind = AssertKind::Require;
+ result.location = loc;
+ result.expression = "require(...)";
+ if (!result.passed) {
+ result.message = "required condition to be true";
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-template requires std::equality_comparable_with
-void expect_eq(const T& lhs, const U& rhs, std::source_location loc = std::source_location::current()) {
- AssertionResult result; result.passed = (lhs == rhs); result.kind = AssertKind::Expect; result.location = loc; result.expected_repr = Detail::repr(rhs); result.actual_repr = Detail::repr(lhs); if (!result.passed) result.message = std::format("expected {}, got {}", Detail::repr(rhs), Detail::repr(lhs)); Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::equality_comparable_with
+ void expect_eq(const T& lhs, const U& rhs,
+ std::source_location loc = std::source_location::current())
+ {
+ AssertionResult result;
+ result.passed = (lhs == rhs);
+ result.kind = AssertKind::Expect;
+ result.location = loc;
+ result.expected_repr = Detail::repr(rhs);
+ result.actual_repr = Detail::repr(lhs);
+ if (!result.passed) {
+ result.message = std::format("expected {}, got {}",
+ Detail::repr(rhs), Detail::repr(lhs));
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-template requires std::equality_comparable_with
-void require_eq(const T& lhs, const U& rhs, std::source_location loc = std::source_location::current()) {
- AssertionResult result; result.passed = (lhs == rhs); result.kind = AssertKind::Require; result.location = loc; result.expected_repr = Detail::repr(rhs); result.actual_repr = Detail::repr(lhs); if (!result.passed) result.message = std::format("required {}, got {}", Detail::repr(rhs), Detail::repr(lhs)); Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::equality_comparable_with
+ void require_eq(const T& lhs, const U& rhs,
+ std::source_location loc = std::source_location::current())
+ {
+ AssertionResult result;
+ result.passed = (lhs == rhs);
+ result.kind = AssertKind::Require;
+ result.location = loc;
+ result.expected_repr = Detail::repr(rhs);
+ result.actual_repr = Detail::repr(lhs);
+ if (!result.passed) {
+ result.message = std::format("required {}, got {}",
+ Detail::repr(rhs), Detail::repr(lhs));
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-template requires std::equality_comparable_with
-void expect_ne(const T& lhs, const U& rhs, std::source_location loc = std::source_location::current()) {
- AssertionResult result; result.passed = (lhs != rhs); result.kind = AssertKind::Expect; result.location = loc; if (!result.passed) result.message = "expected values to differ"; Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::equality_comparable_with
+ void expect_ne(const T& lhs, const U& rhs,
+ std::source_location loc = std::source_location::current())
+ {
+ AssertionResult result;
+ result.passed = (lhs != rhs);
+ result.kind = AssertKind::Expect;
+ result.location = loc;
+ if (!result.passed) {
+ result.message = "expected values to differ";
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-template requires std::invocable
-void expect_throw(Fn&& fn, std::source_location loc = std::source_location::current()) {
- bool threw = false; try { std::forward(fn)(); } catch (const Exception&) { threw = true; } catch (...) {} AssertionResult result; result.passed = threw; result.kind = AssertKind::Expect; result.location = loc; if (!threw) result.message = "expected exception was not thrown"; Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::invocable
+ void
+ expect_throw(Fn&& fn,
+ std::source_location loc = std::source_location::current())
+ {
+ bool threw = false;
+ try {
+ std::forward(fn)();
+ } catch (const Exception&) {
+ threw = true;
+ } catch (...) {
+ }
+ AssertionResult result;
+ result.passed = threw;
+ result.kind = AssertKind::Expect;
+ result.location = loc;
+ if (!threw) {
+ result.message = "expected exception was not thrown";
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-template requires std::invocable
-void expect_nothrow(Fn&& fn, std::source_location loc = std::source_location::current()) {
- bool threw = false; try { std::forward(fn)(); } catch (...) { threw = true; } AssertionResult result; result.passed = !threw; result.kind = AssertKind::Expect; result.location = loc; if (threw) result.message = "expected no exception"; Detail::handle_assertion(std::move(result));
-}
+ template
+ requires std::invocable
+ void expect_nothrow(
+ Fn&& fn, std::source_location loc = std::source_location::current())
+ {
+ bool threw = false;
+ try {
+ std::forward(fn)();
+ } catch (...) {
+ threw = true;
+ }
+ AssertionResult result;
+ result.passed = !threw;
+ result.kind = AssertKind::Expect;
+ result.location = loc;
+ if (threw) {
+ result.message = "expected no exception";
+ }
+ Detail::handle_assertion(std::move(result));
+ }
-inline void fail(std::string_view message = "", std::source_location loc = std::source_location::current()) {
- AssertionResult result; result.passed = false; result.kind = AssertKind::Expect; result.location = loc; result.message = message.empty() ? "explicit failure" : std::string{message}; Detail::handle_assertion(std::move(result));
-}
+ inline void fail(std::string_view message = "",
+ std::source_location loc = std::source_location::current())
+ {
+ AssertionResult result;
+ result.passed = false;
+ result.kind = AssertKind::Expect;
+ result.location = loc;
+ result.message =
+ message.empty() ? "explicit failure" : std::string{message};
+ Detail::handle_assertion(std::move(result));
+ }
-inline void skip(std::string_view reason, std::source_location loc = std::source_location::current()) {
- auto& ctx = Detail::TestContext::current(); if (ctx.current_result) { ctx.current_result->state = TestState::Skipped; ctx.current_result->skip_reason = reason; } throw Detail::RequireFailure{std::string{reason}};
-}
+ inline void skip(std::string_view reason,
+ [[maybe_unused]] std::source_location loc =
+ std::source_location::current())
+ {
+ auto& ctx = Detail::TestContext::current();
+ if (ctx.current_result) {
+ ctx.current_result->state = TestState::Skipped;
+ ctx.current_result->skip_reason = reason;
+ }
+ throw Detail::RequireFailure{std::string{reason}};
+ }
} // namespace Void::Testing
diff --git a/include/Void/Testing/Config.hpp b/include/Void/Testing/Config.hpp
index fc7d4a7..39c3cd0 100644
--- a/include/Void/Testing/Config.hpp
+++ b/include/Void/Testing/Config.hpp
@@ -78,6 +78,7 @@ namespace Void::Testing
std::string reporter{"console"};
std::string output_file;
std::string tag_filter;
+ std::string log_file;
bool list_only{false};
bool verbose{false};
bool no_color{false};
diff --git a/include/Void/TestingMock/Expectation.hpp b/include/Void/TestingMock/Expectation.hpp
index 43bb11d..f90360c 100644
--- a/include/Void/TestingMock/Expectation.hpp
+++ b/include/Void/TestingMock/Expectation.hpp
@@ -1,33 +1,151 @@
#pragma once
+
#include
-#include
+
+#include
+#include
+#include
#include
+#include
#include
+#include
#include
+#include
+#include
-namespace Void::TestingMock::Detail {
+namespace Void::TestingMock::Detail
+{
-template class Expectation;
+ template class Expectation;
+
+ template class Expectation
+ {
+ public:
+
+ using MatcherTuple =
+ std::tuple>...>;
+ /// Move-only function — supports unique_ptr-capturing lambdas
+ /// and other move-only callables.
+ using Action = std::move_only_function;
+
+ Expectation(MatcherTuple matchers, std::source_location loc)
+ : m_matchers(std::move(matchers)), m_location(loc)
+ {
+ }
+
+ template
+ requires(!std::is_void_v && std::same_as)
+ Expectation& returns(U value)
+ {
+ m_action = [val = std::move(value)](Args...) mutable -> R {
+ return val;
+ };
+ return *this;
+ }
+
+ template
+ requires std::invocable
+ Expectation& invokes(F action)
+ {
+ m_action = std::move(action);
+ return *this;
+ }
+
+ Expectation& times(int n)
+ {
+ m_min_calls = n;
+ m_max_calls = n;
+ return *this;
+ }
+
+ Expectation& once() { return times(1); }
+
+ bool matches(Args... args) const
+ {
+ return match_impl(args..., std::index_sequence_for{});
+ }
+
+ R execute(Args... args)
+ {
+ if (!m_action) {
+ if constexpr (std::is_same_v) {
+ return;
+ } else {
+ return R{};
+ }
+ }
+ return m_action(args...);
+ }
+
+ void record_call() { ++m_call_count; }
+
+ bool is_saturated() const { return m_call_count >= m_max_calls; }
+
+ void verify(std::string_view func_name)
+ {
+ if (m_call_count < m_min_calls) {
+ Void::Testing::fail(std::format(
+ "unsatisfied expectation on {}: {} — {}/{} calls",
+ func_name, describe_matchers(), m_call_count,
+ m_min_calls));
+ }
+ }
+
+ // -------- accessors used by failure-message construction --------
+
+ [[nodiscard]] int call_count() const noexcept
+ {
+ return m_call_count;
+ }
+
+ [[nodiscard]] int max_calls() const noexcept { return m_max_calls; }
+
+ [[nodiscard]] std::source_location location() const noexcept
+ {
+ return m_location;
+ }
+
+ /// Render the matcher tuple as e.g. "(Eq(7), _, Gt(3))".
+ [[nodiscard]] std::string describe_matchers() const
+ {
+ return describe_impl(std::index_sequence_for{});
+ }
+
+ private:
+
+ MatcherTuple m_matchers;
+ Action m_action;
+ std::source_location m_location;
+ int m_min_calls{1};
+ int m_max_calls{1};
+ int m_call_count{0};
+
+ template
+ bool match_impl(Args... args, std::index_sequence) const
+ {
+ return (std::get(m_matchers).matches(args) && ...);
+ }
+
+ template
+ std::string describe_impl(std::index_sequence) const
+ {
+ if constexpr (sizeof...(Is) == 0) {
+ return "()";
+ } else {
+ std::string out{"("};
+ bool first = true;
+ auto append = [&](const auto& m) {
+ if (!first) {
+ out += ", ";
+ }
+ out += m.describe();
+ first = false;
+ };
+ (append(std::get(m_matchers)), ...);
+ out += ")";
+ return out;
+ }
+ }
+ };
-template
-class Expectation {
-public:
- using MatcherTuple = std::tuple>...>;
- using Action = std::function;
- Expectation(MatcherTuple matchers, std::source_location loc) : matchers_(std::move(matchers)), location_(loc) {}
- Expectation& returns(R value) { action_ = [val = std::move(value)](Args...) mutable -> R { return val; }; return *this; }
- Expectation& invokes(Action action) { action_ = std::move(action); return *this; }
- Expectation& times(int n) { min_calls_ = n; max_calls_ = n; return *this; }
- Expectation& once() { return times(1); }
- bool matches(Args... args) const { return match_impl(args..., std::index_sequence_for{}); }
- R execute(Args... args) const { if(!action_) return R{}; return action_(args...); }
- void record_call() { call_count_++; }
- bool is_saturated() const { return call_count_ >= max_calls_; }
- void verify(std::string_view func_name) const {
- if(call_count_ < min_calls_) { Void::Testing::fail(std::format("Unsatisfied expectation on {}", func_name)); }
- }
-private:
- MatcherTuple matchers_; Action action_; std::source_location location_; int min_calls_{1}; int max_calls_{1}; int call_count_{0};
- template bool match_impl(Args... args, std::index_sequence) const { return (std::get(matchers_).matches(args) && ...); }
-};
} // namespace Void::TestingMock::Detail
diff --git a/include/Void/TestingMock/Matcher.hpp b/include/Void/TestingMock/Matcher.hpp
index ce0cff2..40cf4b7 100644
--- a/include/Void/TestingMock/Matcher.hpp
+++ b/include/Void/TestingMock/Matcher.hpp
@@ -1,25 +1,279 @@
#pragma once
+
#include
-#include
+
+#include
+#include
#include
#include
+#include
+#include
+#include
-namespace Void::TestingMock {
-template class Matcher { public: virtual ~Matcher() = default; virtual bool matches(const T& value) const = 0; virtual std::string describe() const = 0; };
-template class EqMatcher : public Matcher { T expected_; public: explicit EqMatcher(T expected) : expected_(std::move(expected)) {} bool matches(const T& v) const override { return v == expected_; } std::string describe() const override { return std::format("eq({})", Void::Testing::Detail::repr(expected_)); } };
-template class AnyMatcher : public Matcher { public: bool matches(const T&) const override { return true; } std::string describe() const override { return "_"; } };
+namespace Void::TestingMock
+{
+ template class Matcher
+ {
+ public:
-template auto Eq(T v) { return std::make_unique