mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
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]>
22 lines
446 B
Go
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)
|
|
}
|
|
}
|
|
}
|