Repository navigation
test: cover the git log line that does not parse - #5
Merged
Merged
Conversation
Rust 1.100 counts the implicit else of the if let in commits() as its own line, and no test ever produced a log line without four fields, so coverage dropped to 99.76% and the test check fails on main as well as on every PR. The parsing moves to parse_log, and a unit test feeds it a malformed line, so the skip is actually checked rather than just counted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The test check fails on main right now, not just on PRs. A manual run on main today gives 99.76% lines, with one line missed. The runner moved to rust 1.100, which counts the implicit else of the
if letincommits()as a line of its own, and no test ever produced a git log line without four fields. The nightly only runs audit and deny, which is why nobody saw it.This moves the parsing into
parse_logand adds a unit test that feeds it a malformed line, so the skip is actually checked instead of just counted. Behaviour doesn't change.How I checked it: in a container with rust 1.100.0, cargo-llvm-cov 0.9.1 (same as CI) and a recent git, main reports the single miss at src/cli.rs:273 and this branch reports 100% lines.
This unblocks #4.