Skip to content

Conversation

@QuakeWang
Copy link
Owner

Refer to a related PR or issue link (optional)

This commit relocates the behavior test suite from integration tests
to unit tests within the main crate. The changes include:

  • Remove integration test harness and move all test files into src/tests
  • Update Cargo.toml to remove the behavior test configuration
  • Simplify test utilities and remove unused dependencies
  • Update CI workflows to run behavior tests with unit tests
  • Add test macro for registering behavior test cases
  • Remove large test data files in favor of runtime generation

The behavior tests now run as part of cargo test and can be skipped
by setting the STORIFY_SKIP_BEHAVIOR environment variable.

What's changed and what's your intention?

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary behavior tests.
  • This PR requires documentation updates.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@QuakeWang
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@QuakeWang
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +8 to +11
register_behavior_tests!(
test_head_default_10_lines,
test_head_n_lines,
test_head_nonexistent_file,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore head option coverage

The new unit-test harness only registers three head behavior cases (test_head_default_10_lines, test_head_n_lines, and test_head_nonexistent_file). The previous integration suite also exercised byte-based reads (head -c), zero-length handling, and multi-file output/quiet flags, so those options are no longer covered after this move. That drop in coverage means regressions in head’s byte-counting and multi-file output formatting will now slip through unchecked. Please migrate the missing cases into the new suite.

Useful? React with 👍 / 👎.

Comment on lines +8 to +11
register_behavior_tests!(
test_tail_default_10_lines,
test_tail_n_lines,
test_tail_nonexistent_file,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore tail option coverage

Similarly, the refactored tail behavior tests now cover only the default 10-line case, a -n count, and a missing file, dropping the byte-count (-c), zero-length, and multi-file quiet/verbose scenarios that were present in the old integration suite. With those cases gone, regressions in byte-based tails and multi-file header handling will no longer be detected when the behavior suite runs. Consider porting the missing tests to the new unit-test harness.

Useful? React with 👍 / 👎.

@QuakeWang QuakeWang merged commit bee939c into main Nov 17, 2025
3 checks passed
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.

2 participants