Skip to content

Add head -z integration tests#33

Open
kelp wants to merge 1 commit intomainfrom
worktree-agent-aedd26ef
Open

Add head -z integration tests#33
kelp wants to merge 1 commit intomainfrom
worktree-agent-aedd26ef

Conversation

@kelp
Copy link
Copy Markdown
Owner

@kelp kelp commented Apr 2, 2026

Summary

  • Add 5 behavioral integration tests for head -z (NUL-terminated line mode)
  • Tests cover -z -n, -z -c, stdin pipe, and multi-file with headers
  • Uses hex comparison via od to correctly handle NUL bytes

Audit findings addressed

  • head --silent: already works (verified)
  • head -z integration tests: added (5 tests)
  • cut -w/-z integration tests: already present

Test results

  • zig build test: all pass
  • just it-util head: 88/88 pass
  • just it-util cut: 70/70 pass

The -z flag (NUL-terminated line mode) had zero integration
test coverage. Adds 5 behavioral tests: file input, stdin
pipe, single record, byte mode, and multi-file headers.
Uses hex comparison via od to handle NUL bytes that bash
variables strip.
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