Add tests to verify TXID parsing uses ltx.ParseTXID #682
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive tests to verify that TXID parsing in CLI commands correctly uses
ltx.ParseTXID
, addressing issue #673.Investigation Results
After thorough investigation of the codebase, I found that TXID parsing is already correctly implemented:
txidVar
type incmd/litestream/main.go
(lines 812-831) properly implements TXID parsing usingltx.ParseTXID
restore
command is the only CLI command that accepts TXID arguments via the-txid
flagtxidVar
type, ensuring consistent use ofltx.ParseTXID
Changes
cmd/litestream/txid_parsing_test.go
with comprehensive tests for thetxidVar
typeTest Coverage
The tests verify:
Test Results
Conclusion
No code changes were needed - the implementation already correctly uses
ltx.ParseTXID
for all TXID parsing. This PR adds tests to ensure this behavior is maintained and to prevent regression.Fixes #673
🤖 Generated with Claude Code