Skip to content

Commit 130100b

Browse files
aledbfclaude
andcommitted
test(config): hold the drive check of winBasename
Mutation testing found that no test held node path.win32.basename's drive rule (only a letter and a colon are a drive) in winBasename. The 52-digit check of ComputeDevContainerID gets a mutate-exempt: < 53 pads nothing more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 89b87ab commit 130100b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎internal/config/varsub_test.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,12 @@ func TestComputeDevContainerIDIsPaddedTo52Digits(t *testing.T) {
136136
t.Error("no id needed padding: widen the search")
137137
}
138138
}
139+
140+
// Only a letter followed by a colon is a drive (node path.win32.basename).
141+
func TestWinBasenameDrive(t *testing.T) {
142+
for in, want := range map[string]string{`C:foo`: "foo", `c:\a\b\`: "b", `1:foo`: "1:foo", `C:`: ""} {
143+
if got := winBasename(in); got != want {
144+
t.Errorf("winBasename(%q) = %q, want %q", in, got, want)
145+
}
146+
}
147+
}

0 commit comments

Comments
 (0)