Files
openfsd/internal/server/caps_test.go
Reese Norris 1d65dcfc79 feat: implement SECPOS secondary visibility centers
Advertise SECPOS=1 and apply ' secondary center packets to multi-box
range search so ATC can see pilots outside the primary visibility box.
2026-07-21 18:11:50 -04:00

39 lines
837 B
Go

package server
import (
"strings"
"testing"
)
func TestServerCapabilitiesPayload(t *testing.T) {
p := ServerCapabilitiesPayload()
if p == "" {
t.Fatal("payload empty")
}
// Required tokens for vatSys CheckCompatabilityWithServer / feature gates
// that openfsd actually implements (including SECPOS multi-center range).
for _, flag := range []string{
"VERSION=1",
"SECPOS=1",
"ATCINFO=1",
"NEWATIS=1",
"GLOBALDATA=1",
"ICAOEQ=1",
"ATCMULTI=1",
"FASTPOS=1",
} {
if !strings.Contains(p, flag) {
t.Errorf("payload missing %q: %s", flag, p)
}
}
// Wire form is NAME=1 tokens joined by ':' with no empties.
for _, part := range strings.Split(p, ":") {
if part == "" {
t.Fatalf("empty token in payload %q", p)
}
if !strings.Contains(part, "=") {
t.Errorf("token %q missing =", part)
}
}
}