Added BATS coverage for verbose flag positions and arg passthru.#169
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis pull request adds a comprehensive Bats test suite that validates verbose flag ( ChangesVerbose flag test coverage
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
tests/verbose-flag.batswith 10 new BATS tests covering verbose flag positioning and positional argument passthrough.-v/--verboseanywhere relative to the subcommand and its arguments (before the command, after the command, interspersed with positional args), and that the legacy single-dash pre-parser inflag.gohandles the case where-vappears before the subcommand name.--separator, and that a literal--correctly passes flag-like strings (e.g.-v,--verbose) through as plain arguments rather than activating verbose mode.Test plan
go build -o ./ahoy .completes without errors.go vet ./...reports no issues.go test -v -race ./...passes all unit tests.bats testsruns all BATS tests (125 total, including the 10 new ones) and all pass../ahoy -f tests/testdata/simple.ahoy.yml echo -v helloand confirm the===> Ahoy echoheader appears../ahoy -f tests/testdata/simple.ahoy.yml echo -- -vand confirm output is literally-vwith no debug header.Summary by CodeRabbit