Motivation
assert_array_result() can fail incorrectly when expected is empty. In that case, a row that matches to_match is not counted, and the helper raises “No objects matched” even though a match exists.
What changed
- Update assert_array_result() to increment num_matched immediately after a to_match hit.
- Preserve existing should_not_find behavior.
- Add regression tests in test_framework.util for:
- a matching row with expected={} (passes)
- no matching row with expected={} (raises)
- Add test_framework.util to feature_framework_unit_tests.py so the new tests run in the framework unit test suite.
Why this is correct
Match detection should depend on to_match, not on whether expected has keys. The updated logic counts matches when match truth is established. This fixes the empty-expected false negative while leaving the negative-search path unchanged.
Test plan
0test/lint/lint-python.py
1python3 test/functional/feature_framework_unit_tests.py
2build-codex/test/functional/test_runner.py wallet_listreceivedby.py --jobs=1 --failfast
Notes
This patch is intentionally small and keeps behavior change and regression tests in the same patch.