feat: enhance community attribute handling in BIRD format. Add validation for community route bodies to ensure correct tuple structure and introduce tests for single-element standard arrays, improving error handling and robustness in community attribute processing.

This commit is contained in:
Denozordec
2026-04-06 23:33:54 +07:00
parent 0ca5542f6b
commit b541794d84
2 changed files with 67 additions and 8 deletions
+7
View File
@@ -21,3 +21,10 @@ func TestRouteCommunityAttrs_LargeJSON(t *testing.T) {
t.Fatalf("got %q", s)
}
}
func TestRouteCommunityAttrs_StandardArrayOneElement(t *testing.T) {
_, err := RouteCommunityAttrs("", "x", `{"standard":[65000]}`)
if err == nil {
t.Fatal("expected error for single-element standard pair")
}
}