test_search_prose_limit_and_bad_expression

Tests › tests/test_query.py

passed Passed in the packaged run.

What this test is for

Why it exists

The limit is honoured, and an FTS5-invalid expression is retried as a literal phrase instead of surfacing a syntax error to the caller.

Verifies REQ-DDB-QUERY-002

Given

  1. —
→

When

  1. q.search_prose(rich_db, "the OR robot OR key", limit=2)
  2. q.search_prose(rich_db, 'unbalanced " quote')
→

Then

  1. ✓ len(q.search_prose(rich_db, "the OR robot OR key", limit=2)) is at most 2

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) · 11 of 400 steps

… 215 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)loopmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 73 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesother filesopt (line 1012)optmain294. corpus_payload → _prose_corpus294_prose_corpus295. _prose_corpus → search_prose_graded295search_prose_graded296. search_prose_graded → _query_tokens296_query_tokens▶ test enters297. search_prose_graded → connect297connect298. search_prose_graded → table_exists298table_exists299–300. search_prose_graded → _fts_match299_fts_match +1 more301. search_prose_graded → strip_xml301strip_xml302. search_prose_graded → list302list303. search_prose_graded → member_doc_rows303member_doc_rows304. member_doc_rows → table_exists304table_exists305. member_doc_rows → has_columns305has_columns306. search_prose_graded → _collapse306_collapse307. _prose_corpus → prose_emptiness307prose_emptiness308. prose_emptiness → has_prose_corpus308has_prose_corpus

… 92 later steps

2 more

tests/test_query.py:918 · its file's page

What it checks (1)

  1. assert len(q.search_prose(rich_db, "the OR robot OR key", limit=2)) <= 2 observes search_prose

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

test_search_prose_limit_and_bad_expression→search_prose

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_search_prose_limit_and_bad_expression · 1 checkssearch_proseREQ-DDB-QUERY-001 · measuredsearch_prosesearch_prose_gradedtable_existsREQ-DDB-QUERY-003 · measuredsearch_prosesearch_prose_gradedmember_doc_rowsREQ-DDB-QUERY-007 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-QUERY-002catalogunknown
Also reaches 3 requirements

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