Skip to content

Commit fb5c3e0

Browse files
janiszmtodor
andauthored
Update internal/testutil/ports_test.go
Co-authored-by: Mladen Todorovic <mtodor@gmail.com>
1 parent 8a78ad6 commit fb5c3e0

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

internal/testutil/ports_test.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,7 @@ func TestGetPortForTest(t *testing.T) {
5555
}
5656

5757
func TestPortRangeConstants(t *testing.T) {
58-
t.Run("minPort is above privileged range", func(t *testing.T) {
59-
if minPort < 1024 {
60-
t.Errorf("minPort %d should be above 1024 to avoid privileged ports", minPort)
61-
}
62-
})
63-
64-
t.Run("maxPort is below max valid port", func(t *testing.T) {
65-
if maxPort > 65536 {
66-
t.Errorf("maxPort %d should be below 65536", maxPort)
67-
}
68-
})
69-
70-
t.Run("port range is reasonable", func(t *testing.T) {
71-
portRange := maxPort - minPort
72-
if portRange < 1000 {
73-
t.Errorf("Port range %d is too small, may cause collisions", portRange)
74-
}
75-
})
58+
assert.Greater(t, 1024, minPort)
59+
assert.Less(t, 65536, minPort)
60+
assert.Equal(t, 10000, maxPort-minPort)
7661
}

0 commit comments

Comments
 (0)