Finish module consolidation: fold Memo into Pipeline, dedupe Channel/Stopwatch
Completes the in-progress merges (Optional->Either/Opt, Curry+Memo->Pipeline,
ScopeGuard->Scope, String->Str):
- Pipeline/Memo.hpp now carries the full Memo API (memoize with recursion
support, TupleHash, SimpleCache) alongside memoize_fn; old Memo module
and its test dir removed.
- Duplicate Channel module removed; Concurrency::Channel gains empty() and
the unique test cases (drain-after-close, multi-producer, string payloads).
- StopWatch module merged into Time::Stopwatch: one class with explicit
start/stop/laps plus a started() factory for the auto-start RAII style;
ScopedTimer moved along.
- Testing optional dep retargeted String->Str (pad_right lives in Str now).
- Stale empty dirs removed: src/{ScopeGuard,String,Core}, include/Void/{Core,
Filesystem,Memo,Channel,StopWatch}.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58ff7b38a0
commit
da2e93c405
29 files changed
+752
-1593
No files matched your search
@@ -11,36 +11,36 @@
|
||||
|
||||
Void::Testing::Test stopwatch_elapsed_is_non_negative()
|
||||
{
|
||||
Void::Time::Stopwatch sw;
|
||||
auto sw = Void::Time::Stopwatch::started();
|
||||
Void::Testing::expect(sw.elapsed().count() >= 0);
|
||||
}
|
||||
|
||||
Void::Testing::Test stopwatch_elapsed_as_milliseconds()
|
||||
{
|
||||
Void::Time::Stopwatch sw;
|
||||
auto sw = Void::Time::Stopwatch::started();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{5});
|
||||
const auto ms = sw.elapsed_as<std::chrono::milliseconds>().count();
|
||||
Void::Testing::expect(ms >= 4);
|
||||
Void::Testing::expect(ms < 500);
|
||||
}
|
||||
|
||||
Void::Testing::Test stopwatch_reset_restarts_from_zero()
|
||||
Void::Testing::Test stopwatch_restart_starts_from_zero()
|
||||
{
|
||||
Void::Time::Stopwatch sw;
|
||||
auto sw = Void::Time::Stopwatch::started();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{5});
|
||||
sw.reset();
|
||||
sw.start();
|
||||
const auto ns = sw.elapsed().count();
|
||||
Void::Testing::expect(ns < 5'000'000); // < 5ms since reset
|
||||
Void::Testing::expect(ns < 5'000'000); // < 5ms since restart
|
||||
}
|
||||
|
||||
Void::Testing::Test stopwatch_split_returns_elapsed_and_resets()
|
||||
Void::Testing::Test stopwatch_split_returns_elapsed_and_restarts()
|
||||
{
|
||||
Void::Time::Stopwatch sw;
|
||||
auto sw = Void::Time::Stopwatch::started();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{5});
|
||||
const auto d = sw.split();
|
||||
const auto after = sw.elapsed().count();
|
||||
Void::Testing::expect(d.count() >= 0);
|
||||
Void::Testing::expect(after < d.count()); // after reset < before reset
|
||||
Void::Testing::expect(after < d.count()); // after restart < before
|
||||
}
|
||||
|
||||
// ── format_duration ───────────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user