package hostclaim import ( "strings" "testing" ) func TestPlan12RetiredLocationWriteGate(t *testing.T) { for _, enabled := range []string{"", "1"} { t.Setenv("CARLOS_HOST_CLAIM_RETIRED_LOCATIONS", enabled) inc := strings.Repeat("a", 64) c := &Claim{Host: "shop.example", Holder: &Holder{Incarnation: inc, Location: "instances/shop.example"}} retire(c, inc) if (c.RetiredLocations[inc] != "") != (enabled == "1") { t.Fatal(enabled, c.RetiredLocations) } } }