|
|
|
|
@ -1573,6 +1573,33 @@ func TestValue_PrimitiveAttributes(t *testing.T) {
|
|
|
|
|
attribute: cty.String,
|
|
|
|
|
validateChange: change.ValidatePrimitive(strptr("\"old\""), strptr("\"old\""), plans.NoOp, false),
|
|
|
|
|
},
|
|
|
|
|
"dynamic": {
|
|
|
|
|
input: Value{
|
|
|
|
|
Before: "old",
|
|
|
|
|
After: "new",
|
|
|
|
|
},
|
|
|
|
|
attribute: cty.DynamicPseudoType,
|
|
|
|
|
validateChange: change.ValidatePrimitive(strptr("\"old\""), strptr("\"new\""), plans.Update, false),
|
|
|
|
|
validateSliceChanges: []change.ValidateChangeFunc{
|
|
|
|
|
change.ValidatePrimitive(strptr("\"old\""), nil, plans.Delete, false),
|
|
|
|
|
change.ValidatePrimitive(nil, strptr("\"new\""), plans.Create, false),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"dynamic_type_change": {
|
|
|
|
|
input: Value{
|
|
|
|
|
Before: "old",
|
|
|
|
|
After: 4.0,
|
|
|
|
|
},
|
|
|
|
|
attribute: cty.DynamicPseudoType,
|
|
|
|
|
validateChange: change.ValidateTypeChange(
|
|
|
|
|
change.ValidatePrimitive(strptr("\"old\""), nil, plans.Delete, false),
|
|
|
|
|
change.ValidatePrimitive(nil, strptr("4"), plans.Create, false),
|
|
|
|
|
plans.Update, false),
|
|
|
|
|
validateSliceChanges: []change.ValidateChangeFunc{
|
|
|
|
|
change.ValidatePrimitive(strptr("\"old\""), nil, plans.Delete, false),
|
|
|
|
|
change.ValidatePrimitive(nil, strptr("4"), plans.Create, false),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
for name, tmp := range tcs {
|
|
|
|
|
tc := tmp
|
|
|
|
|
|