test_doxygen_any_refuses_another_configurations_output

Tests › tests/test_indexcache_doxygen_cache.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE REGRESSION THIS CLOSES SHIPPED ONCE AND WAS CAUGHT BY SOMEBODY ELSE'S TEST.

Given

  1. output = tmp_path / "doxygen.db"
  2. output.write_bytes(b"pretend this is a doxygen database")
7 more
  1. cache = IndexCache(tmp_path / "sidecar.db", tmp_path)
  2. narrow = cache.config_sha("INPUT = src\n", [])
  3. wide = cache.config_sha("INPUT = .\n", [])
  4. cache.doxygen_put("tree-1", output, narrow)
  5. cache.conn.execute("UPDATE doxygen_cache SET config_sha = '' WHERE tree_sha = 'tree-1'")
  6. cache.commit()
  7. cache.close()
→

When

  1. —
→

Then

  1. ✓ narrow differs from wide
  2. ✓ cache.doxygen_any(narrow) equals output
  3. ✓ cache.doxygen_any(wide) is None
  4. ✓ cache.doxygen_any(narrow) is None

tests/test_indexcache_doxygen_cache.py:196 · its file's page

What it checks (4)

  1. assert narrow != wide, "two different Doxyfiles must not share a configuration hash" not attributed
  2. assert cache.doxygen_any(narrow) == output, ( "output built under THIS configuration must be available to splice into, or the " "incremental path can never engage at all" ) not attributed
  3. assert cache.doxygen_any(wide) is None, ( "output built under a DIFFERENT configuration was served for splicing — this is " "#399's aliasing, and it silently produces an index carrying the old scope's rows" ) not attributed
  4. assert cache.doxygen_any(narrow) is None, ( "a row with no recorded configuration was assumed compatible; an unknown " "configuration must refuse rather than be guessed at" ) not attributed

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.

Also reaches 1 requirement

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