test_an_unparsed_file_is_registered_as_known_but_unread

Tests › tests/test_unparsed_file_registration.py

passed Passed in the packaged run.

What this test is for

Why it exists

RED BEFORE THE FIX: `claims()` returns False for `.pl`, so `register_paths` inserts no row and the file is not in the file set at all.

Given

  1. db = tmp_path / "clew.db"
  2. conn = sqlite3.connect(str(db))
3 more
  1. conn.execute( "CREATE TABLE path (rowid INTEGER PRIMARY KEY, type INTEGER, local INTEGER, " "found INTEGER, name TEXT)" )
  2. conn.commit()
  3. conn.close()
→

When

  1. inserted = register_paths(db, ["scripts/generate_errors.pl", "src/app.ts"])
  2. conn = sqlite3.connect(str(db))
  3. rows = dict(conn.execute("SELECT name, found FROM path"))
  4. conn.close()
→

Then

  1. ✓ inserted equals 2
  2. ✓ rows["scripts/generate_errors.pl"] equals 0
  3. ✓ rows["src/app.ts"] equals 1

tests/test_unparsed_file_registration.py:92 · its file's page

What it checks (3)

  1. assert inserted == 2, "both the unparsed file and the claimed TS file must be registered" observes register_paths via inserted
  2. assert rows["scripts/generate_errors.pl"] == 0, ( "a file no grammar reads must report that it was NOT resolved to content; found=1 would " "claim it was parsed" ) not attributed
  3. assert rows["src/app.ts"] == 1, ( "C5 must not change what a file the parse front end DOES read reports" ) 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

test_an_unparsed_file_is_registered_as_known_but_unread→register_paths

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_an_unparsed_file_is_registered_as_known_but_unread · 3 checksregister_pathsREQ-DDB-PIPE-012 · measured
Also reaches 1 requirement

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