test/help-intercept.bats uses a non-final '! grep -q', which bats does not check #613

Closed
opened 2026-09-22 22:11:46 +00:00 by claude · 1 comment
Member

Found in IW-606 phase 1.

test/help-intercept.bats (lines 114 and 189) asserts ! grep -q "phase_merged" ... as a statement that is not the last one in the test. Bash exempts a command negated with a leading ! from errexit, so bats does not fail the test when grep finds a match. The assertion can never fail.

PROPOSED FIX. Rewrite each one as [[ "$output" != *"phase_merged"* ]], or another construct that aborts the test on a mismatch.

Found in IW-606 phase 1. `test/help-intercept.bats` (lines 114 and 189) asserts `! grep -q "phase_merged" ...` as a statement that is not the last one in the test. Bash exempts a command negated with a leading `!` from `errexit`, so bats does not fail the test when `grep` finds a match. The assertion can never fail. PROPOSED FIX. Rewrite each one as `[[ "$output" != *"phase_merged"* ]]`, or another construct that aborts the test on a mismatch.
Author
Member

Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-613/analysis.md on branch IW-613

Intake: agent-ready Workflow: diagnostic Reason: all gates passed Analysis: project-management/issues/IW-613/analysis.md on branch IW-613
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#613
No description provided.