Commit 4b85c94
committed
test(unordered_lru_cache): add comprehensive unit tests
Add Boost.Test suite with 17 test cases covering:
- Construction and configuration (runtime/compile-time sizing)
- Basic API behavior (insert, get, emplace, exists, erase, clear)
- LRU and truncation semantics (threshold behavior, recency tracking)
- Edge cases (maxSize=1, various threshold combinations)
Also optimize truncate_if_needed() to use std::nth_element instead
of std::sort for O(N) average complexity instead of O(N log N).1 parent b08eab3 commit 4b85c94
File tree
3 files changed
+407
-3
lines changed- src
- test
3 files changed
+407
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
0 commit comments