42e3c0c925
Made-with: Cursor
23 lines
679 B
Go
23 lines
679 B
Go
package scans
|
|
|
|
import "testing"
|
|
|
|
func TestClassifyPortKind(t *testing.T) {
|
|
const accessMax, trunkMin = 8, 32
|
|
if g := ClassifyPortKind(1, accessMax, trunkMin); g != "access" {
|
|
t.Fatalf("1 -> access, got %q", g)
|
|
}
|
|
if g := ClassifyPortKind(8, accessMax, trunkMin); g != "access" {
|
|
t.Fatalf("8 -> access, got %q", g)
|
|
}
|
|
if g := ClassifyPortKind(9, accessMax, trunkMin); g != "ambiguous" {
|
|
t.Fatalf("9 -> ambiguous, got %q", g)
|
|
}
|
|
if g := ClassifyPortKind(31, accessMax, trunkMin); g != "ambiguous" {
|
|
t.Fatalf("31 -> ambiguous, got %q", g)
|
|
}
|
|
if g := ClassifyPortKind(32, accessMax, trunkMin); g != "strong_transit" {
|
|
t.Fatalf("32 -> strong_transit, got %q", g)
|
|
}
|
|
}
|