test_token_counts_span_symbols_and_file_docs

Tests › tests/test_emptiness.py

passed Passed in the packaged run.

What this test is for

Why it exists

A token matching only a file's documentation did NOT empty the query, and saying otherwise would send the caller to drop the one token that was working.

Given

  1. —
→

When

  1. token_hit_counts(db, ["re-entry"])
  2. token_hit_counts(db, ["nowhere"])
→

Then

  1. ✓ token_hit_counts(db, ["re-entry"]) equals {"re-entry": 1}
  2. ✓ token_hit_counts(db, ["nowhere"]) equals {"nowhere": 0}

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

clew — `main` (clew/cli.py) · 10 of 400 steps

… 214 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)loopmain215–216. search_counted → _memberdef_corpora215_memberdef_corpora +1 more217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 12 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pymain233. _class_candidates → _search_rank233_search_rank234. _class_candidates → class_rows234class_rows235. class_rows → table_exists235table_exists236. class_rows → strip_xml236strip_xml237. search_counted → _config_candidates237_config_candidates

… 7 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pymain245. _file_candidates → _doc_brief245_doc_brief246. _file_candidates → file_doc_rows246file_doc_rows247. file_doc_rows → table_exists247table_exists248. _file_candidates → undocumented_path_rows248undocumented_path_rows249. undocumented_path_rows → table_exists249table_exists

… 25 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesopt (line 1968)optopt (line 333)optloop (line 1856)loopopt (line 1902)optmain275. unsearched_corpora → _unread_kind_counts275_unread_kind_counts276. search_emptiness → token_hit_counts276token_hit_counts277. token_hit_counts → connect277connect▶ test enters278. token_hit_counts → _one_token_count278_one_token_count279. _one_token_count → table_exists279table_exists280. _one_token_count → _expansion_sql280_expansion_sql281. _one_token_count → class_rows281class_rows282. _one_token_count → file_doc_rows282file_doc_rows283–284. search_emptiness → _conjunction_note283_conjunction_note +1 more

… 116 later steps

2 more

tests/test_emptiness.py:224 · its file's page

What it checks (2)

  1. assert token_hit_counts(db, ["re-entry"]) == {"re-entry": 1} observes token_hit_counts
  2. assert token_hit_counts(db, ["nowhere"]) == {"nowhere": 0} observes token_hit_counts

Where the product reaches it

  • main → query_main → _payload → export_search → corpus_payload → _symbol_corpus → search_emptiness → token_hit_counts (flow)

Call flow

test_token_counts_span_symbols_and_file_docs→token_hit_counts

What 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.

test_token_counts_span_symbols_and_file_docs · 2 checkstoken_hit_countsconnectREQ-DDB-QUERY-001 · measuredtoken_hit_counts_one_token_counttable_existsREQ-DDB-QUERY-003 · measuredtoken_hit_countsREQ-DDB-QUERY-007 · measured
Also reaches 3 requirements

Its run touches their code; that is reach, not proof.