build: reconcile module dependency closures, Log.hpp ownership, and consumer tests (X-BASE-03)
This commit is contained in:
1 parent
e385746b74
commit
cd6fc7e5f5
19 files changed
+318
-52
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user