You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
review_log.t27: tests cannot tell str_starts_with from contains #7396
specs/queen/review_log.t27 classifies reviewer log lines. Two of its rules are prefix rules:
a line that starts with reviewer: gh pr list is a listing error (LISTING_ERROR_504 when it also carries HTTP 504, otherwise LISTING_ERROR_OTHER);
a line that starts with gh pr list -R: transient failure is a RETRY.
#7359 (b3617f2) replaced the body of the local str_starts_with helper, which had been a substring check, with a real prefix check. That was a correct fix, but none of the spec's 14 test blocks noticed: every fixture line that hits these rules starts with the needle, so the old substring body and the new prefix body give the same answers on all of them.
A test suite that passes for both the buggy and the fixed body does not pin the fix. If str_starts_with drifts back to str_contains, nothing goes red.
Fix
Add test blocks whose answer depends on the difference:
A line that contains reviewer: gh pr list but does not start with it (for example x reviewer: gh pr list -R -> HTTP 504: ...) classifies as OTHER, while the real prefixed line still classifies as LISTING_ERROR_504.
The same pair for the gh pr list -R: transient failure prefix: embedded is OTHER, prefixed is RETRY.
Direct assertions on str_starts_with (needle in the middle, needle at the start, needle longer than the haystack).
Negative control: in a temporary copy whose str_starts_with body is replaced with return str_contains(haystack, needle);, t27c test-report shows FAIL >= 1.
Activity
review_log: tests tell a prefix from a substring (Closes #7396) (#7405)