Files
w3cjandClaude Opus 5.5 ae7c8b619f refactor(platform): parsePortRangeFirst and its test move to the linux files
Its only caller is ports_linux.go's ephemeralFirst, so on darwin
mise run deadcode listed it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 16:58:07 -07:00

22 lines
446 B
Go

package platform
import "testing"
func TestParsePortRangeFirst(t *testing.T) {
for _, tc := range []struct {
in string
want int
ok bool
}{
{"32768\t60999\n", 32768, true},
{"40000 65000", 40000, true},
{"", 0, false},
{"x 1", 0, false},
{"70000 80000", 70000, false},
} {
if n, ok := parsePortRangeFirst(tc.in); ok != tc.ok || ok && n != tc.want {
t.Errorf("parsePortRangeFirst(%q) = %d, %v", tc.in, n, ok)
}
}
}