Duplicate key overwrites existing entry¶
Tests › tests/unit/inference/prompt_cache_test.cpp
What this test is for
Why it exists
The test says nothing about why.
tests/unit/inference/prompt_cache_test.cpp:328 · its file's page
What it checks (6)
REQUIRE(cache.entry_count() == 1)observesentry_countREQUIRE(cache.bytes_used() == 200)observesbytes_usedREQUIRE(entry != nullptr)not attributedREQUIRE(entry->data_size == 200)not attributedREQUIRE(entry->token_count == 20)not attributedREQUIRE(entry->data[0] == 0xBB)not attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
Duplicate key overwrites existing entry→make_key→store→make_data→WHEN→REQUIRE→entry_count→bytes_used→lookupWhat it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.