coverage: easy-wins batch across cli, system, paths, vmdns, toolingplan
Pure-Go tests for formatters, layout resolution, and validators — no fixtures, no external processes. Targets previously-zero functions the triage scan flagged as low-hanging fruit. cli 55% -> 65% paths 64% -> 91% system 65% -> 75% vmdns 72% -> 86% toolingplan 73% -> 78% Total 52.6% -> 54.0%.
This commit is contained in:
parent
a3cc296523
commit
f8979de58a
5 changed files with 740 additions and 0 deletions
23
internal/toolingplan/rust_test.go
Normal file
23
internal/toolingplan/rust_test.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package toolingplan
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFirstMeaningfulLine(t *testing.T) {
|
||||
cases := []struct {
|
||||
in, want string
|
||||
}{
|
||||
{"", ""},
|
||||
{"\n\n\n", ""},
|
||||
{" \n \n", ""},
|
||||
{"# just a comment\n# another\n", ""},
|
||||
{"1.75.0\n", "1.75.0"},
|
||||
{" 1.75.0 ", "1.75.0"},
|
||||
{"# pinned toolchain\n1.75.0\nmore junk\n", "1.75.0"},
|
||||
{"\n\n stable-x86_64-unknown-linux-gnu \n", "stable-x86_64-unknown-linux-gnu"},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
if got := firstMeaningfulLine(tc.in); got != tc.want {
|
||||
t.Errorf("firstMeaningfulLine(%q) = %q, want %q", tc.in, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue