Repository navigation
Test that depends_on matches as in DID-matlab, case for case - #106
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DID-matlab's SQLite search matched
depends_onwithLIKE "%NAME,VALUE;%":idalso matchedsubject_idIDmatchedidDID-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 newtests/+did/+unittest/TestDependsOnParity.m, with identical expected results. Each case runs on the SQLite search, onfield_search, and as the second term of an AND. There is also a test with twodepends_onqueries ANDed together. The cases cover:'*'(any name)'subject*', which is not a glob~depends_onwith an exact name,'*',''and a case differenceNo 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. Eachdecision_lognames that commit and says why nothing needed porting:database→124cf5e: the SQL now matches what_depends_on_sql_clausealready 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_searchalready did this.databaseandqueryeach had twodecision_logkeys, 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 xfailedblack --checkandruff check: cleanbin/check_bridge_coverage.pywithfile,hash,status,drift,memberandmissing: 0 problems eachGenerated by Claude Code