build: reconcile module dependency closures, Log.hpp ownership, and consumer tests (X-BASE-03)

This commit is contained in:
faumaray committed 2026-11-24 02:28:33 +03:00
1 parent e385746b74
commit cd6fc7e5f5
19 files changed
+318 -52

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 4.0)
project(VoidFoundationConsumer LANGUAGES CXX)
find_package(Void CONFIG REQUIRED COMPONENTS
Math
Text
Time
Functional
Binary
FunctionalCoreFormatting
)
add_executable(void_foundation_consumer main.cpp)
target_link_libraries(void_foundation_consumer PRIVATE
Void::Math
Void::Text
Void::Time
Void::Functional
Void::Binary
Void::FunctionalCoreFormatting
)
enable_testing()
add_test(NAME VoidFoundationConsumer COMMAND void_foundation_consumer)
+47
View File
@@ -0,0 +1,47 @@
#include <Void/Binary/Reader.hpp>
#include <Void/Functional/Result.hpp>
#include <Void/FunctionalCoreFormatting/Repr.hpp>
#include <Void/Math/Numeric.hpp>
#include <Void/Text/Str.hpp>
#include <Void/Time/Stopwatch.hpp>
#include <array>
#include <bit>
#include <cstddef>
#include <cstdint>
namespace
{
struct Point {
int x;
int y;
};
} // namespace
int main()
{
const auto sum = Void::Numeric::checked_add(19, 23);
if (!sum || *sum != 42) {
return 1;
}
const auto trimmed = Void::Str::trim(" void ");
if (trimmed != "void") {
return 1;
}
Void::Time::Stopwatch sw;
sw.start();
(void)sw.stop();
const std::array bytes{std::byte{0x00}, std::byte{0x2A}};
Void::Binary::Reader reader{bytes};
const auto num = reader.read<std::uint16_t>(std::endian::big);
if (!num || *num != 42) {
return 1;
}
const auto r = Void::Result::ok(Point{1, 2});
const auto text = Void::Result::Detail::repr(*r);
return !text.empty() ? 0 : 1;
}