Skip to content

Test that depends_on matches as in DID-matlab, case for case - #106

Merged
stevevanhooser merged 1 commit into
mainfrom
claude/did-depends-on-parity
Oct 24, 2026
Merged

stevevanhooser merged 1 commit into
mainfrom
claude/did-depends-on-parity

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Why

DID-matlab's SQLite search matched depends_on with LIKE "%NAME,VALUE;%":

  • an empty name matched any dependency name
  • id also matched subject_id
  • ID matched id

DID-python already matched exactly in its SQL search (#101), so the two languages gave different results. VH-Lab/DID-matlab#235 (merged in 2092b81) fixed the MATLAB side. This PR adds a test shared with that one, so the two cannot drift apart again.

Change

  • tests/test_depends_on_parity.py (new). It uses the same five documents and the same 16 cases as DID-matlab's new tests/+did/+unittest/TestDependsOnParity.m, with identical expected results. Each case runs on the SQLite search, on field_search, and as the second term of an AND. There is also a test with two depends_on queries ANDed together. The cases cover:

    • an empty name (matches nothing)
    • '*' (any name)
    • an exact name
    • a name that is a suffix of another name
    • a difference in name case and in value case
    • the second of two dependencies
    • a name and a value taken from different dependencies
    • 'subject*', which is not a glob
    • ~depends_on with an exact name, '*', '' and a case difference
  • No behaviour change. DID-python main already passes every case.

  • Bridge (did_matlab_python_bridge.yaml, did_matlab_python_bridge_util.yaml). Each entry below is re-pointed at the DID-matlab#235 commit that touched its file. Each decision_log names that commit and says why nothing needed porting:

    • database → 124cf5e: the SQL now matches what _depends_on_sql_clause already did. Queries SQL cannot match exactly are brute-forced.
    • query → a7ed185: help text only.
    • fieldsearch → 051f535: ~hasanysubfield_* on a field that is not a struct now matches. field_search already did this.

    database and query each had two decision_log keys, and YAML keeps only the last one. The notes were therefore added to the key that is actually read. The earlier, shadowed key was left as it was.

Checks

All run locally against DID-matlab main at 2092b81:

  • pytest: 834 passed, 10 skipped, 1 xfailed
  • black --check and ruff check: clean
  • bin/check_bridge_coverage.py with file, hash, status, drift, member and missing: 0 problems each

Generated by Claude Code

tests/test_depends_on_parity.py runs the same five documents and sixteen
cases as DID-matlab's new TestDependsOnParity on the SQLite search, on
field_search and within an AND: an empty name matches nothing, '*' any name,
a name exactly (not a suffix of another, not another case), only '*' is a
wildcard, and the negated form is the complement. DID-python main already
passes all of them; DID-matlab's SQL search did not until DID-matlab#235.

Bridge: database and query re-pointed at DID-matlab a7ed185, with the
decision that nothing needs porting (SQLiteDB's _depends_on_sql_clause
already matches this way; query.m only gained help text).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BLjcMbQRXr5MDdivxzYEc
@stevevanhooser
stevevanhooser merged commit e245179 into main Oct 24, 2026
7 checks passed
@stevevanhooser
stevevanhooser deleted the claude/did-depends-on-parity branch October 24, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants