From f195ce7fd42975d30d48b7d5758537690aea01b6 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 31 Aug 2021 11:17:32 -0400 Subject: [PATCH] remove temp test --- internal/plans/objchange/plan_valid_test.go | 82 --------------------- 1 file changed, 82 deletions(-) diff --git a/internal/plans/objchange/plan_valid_test.go b/internal/plans/objchange/plan_valid_test.go index dedb3958b..834d10463 100644 --- a/internal/plans/objchange/plan_valid_test.go +++ b/internal/plans/objchange/plan_valid_test.go @@ -1486,85 +1486,3 @@ func TestAssertPlanValid(t *testing.T) { }) } } - -func TestAssertPlanValidTEST(t *testing.T) { - tests := map[string]struct { - Schema *configschema.Block - Prior cty.Value - Config cty.Value - Planned cty.Value - WantErrs []string - }{ - "computed in map": { - &configschema.Block{ - Attributes: map[string]*configschema.Attribute{ - "items": { - NestedType: &configschema.Object{ - Nesting: configschema.NestingMap, - Attributes: map[string]*configschema.Attribute{ - "name": { - Type: cty.String, - Computed: true, - Optional: true, - }, - }, - }, - Required: true, - }, - }, - }, - cty.NullVal(cty.Object(map[string]cty.Type{ - "items": cty.Map(cty.Object(map[string]cty.Type{ - "name": cty.String, - })), - })), - cty.ObjectVal(map[string]cty.Value{ - "items": cty.MapVal(map[string]cty.Value{ - "one": cty.ObjectVal(map[string]cty.Value{ - "name": cty.NullVal(cty.String), - //"name": cty.StringVal("computed"), - }), - }), - }), - cty.ObjectVal(map[string]cty.Value{ - "items": cty.MapVal(map[string]cty.Value{ - "one": cty.ObjectVal(map[string]cty.Value{ - "name": cty.StringVal("computed"), - }), - }), - }), - nil, - }, - } - for name, test := range tests { - t.Run(name, func(t *testing.T) { - errs := AssertPlanValid(test.Schema, test.Prior, test.Config, test.Planned) - - wantErrs := make(map[string]struct{}) - gotErrs := make(map[string]struct{}) - for _, err := range errs { - gotErrs[tfdiags.FormatError(err)] = struct{}{} - } - for _, msg := range test.WantErrs { - wantErrs[msg] = struct{}{} - } - - t.Logf( - "\nprior: %sconfig: %splanned: %s", - dump.Value(test.Planned), - dump.Value(test.Config), - dump.Value(test.Planned), - ) - for msg := range wantErrs { - if _, ok := gotErrs[msg]; !ok { - t.Errorf("missing expected error: %s", msg) - } - } - for msg := range gotErrs { - if _, ok := wantErrs[msg]; !ok { - t.Errorf("unexpected extra error: %s", msg) - } - } - }) - } -}