Skip to content

Fix nl, head, timeout integration tests#28

Open
kelp wants to merge 1 commit intomainfrom
fix-nl-head-timeout-it
Open

Fix nl, head, timeout integration tests#28
kelp wants to merge 1 commit intomainfrom
fix-nl-head-timeout-it

Conversation

@kelp
Copy link
Copy Markdown
Owner

@kelp kelp commented Mar 31, 2026

Summary

  • nl: Fix two test expectations to match GNU coreutils behavior. Footer numbering counter resets on section transition (POSIX/GNU), not continues. Blank line join test uses printf for exact whitespace matching (7-space indent on unnumbered blanks, tab after numbered blanks).
  • head: Change -n negative value test from -5 (now valid as negative suffix meaning "all but last 5") to 0x5 (truly invalid value), matching the unit test fix in 5f45c28.
  • timeout: Add preprocessArgs to insert -- before COMMAND positional so child flags (e.g., bash -c) are not parsed by timeout's argparse. Return KILL exit code (137) when --kill-after fires instead of generic 124.

Test plan

  • just it-util nl -- 55/55 pass
  • just it-util head -- 83/83 pass
  • just it-util timeout -- 26/26 pass
  • zig build test -- all unit tests pass

nl: Fix test expectations to match GNU behavior. Footer
counter resets on section transition (POSIX/GNU). Blank
line join test uses printf for exact whitespace matching.

head: Change -n negative value test from -5 (now valid
as negative suffix) to 0x5 (truly invalid).

timeout: Preprocess args to insert -- before COMMAND so
child flags like bash -c are not parsed by timeout.
Return KILL exit code (137) when --kill-after fires.
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.

1 participant