// SPDX-License-Identifier: MPL-2.0 package cms import ( "encoding/json" "strings" "testing" ) func TestAssociationsBoundsAndIdentity(t *testing.T) { source := Reference{Kind: "project", ID: "project-one"} valid := Associations{Terms: []string{"go"}, Links: []Reference{{Kind: "news", ID: "launch"}}} if valid.Validate(source) != nil { t.Fatal("valid association rejected") } for _, value := range []Associations{ {Terms: []string{"go", "go"}}, {Terms: []string{"../private"}}, {Links: []Reference{source}}, {Links: []Reference{{Kind: "news", ID: "launch"}, {Kind: "news", ID: "launch"}}}, {Links: []Reference{{Kind: "