"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/plans/objchange/objchange_test.go" between
terraform-1.0.8.tar.gz and terraform-1.0.9.tar.gz

About: Terraform is a tool for building, changing, and versioning a datacenter infrastructure (written in Go).

objchange_test.go  (terraform-1.0.8):objchange_test.go  (terraform-1.0.9)
skipping to change at line 1539 skipping to change at line 1539
}), }),
}), }),
cty.ObjectVal(map[string]cty.Value{ cty.ObjectVal(map[string]cty.Value{
"set": cty.SetVal([]cty.Value{ "set": cty.SetVal([]cty.Value{
cty.ObjectVal(map[string]cty.Value{ cty.ObjectVal(map[string]cty.Value{
"bar": cty.StringVal("new"), "bar": cty.StringVal("new"),
}), }),
}), }),
}), }),
}, },
"prior null nested objects": {
&configschema.Block{
Attributes: map[string]*configschema.Attribute{
"single": {
NestedType: &configschema.Object{
Nesting: configschema.Nes
tingSingle,
Attributes: map[string]*c
onfigschema.Attribute{
"list": {
NestedTyp
e: &configschema.Object{
N
esting: configschema.NestingList,
A
ttributes: map[string]*configschema.Attribute{
"foo": {
Type: cty.String,
},
}
,
},
Optional:
true,
},
},
},
Optional: true,
},
"map": {
NestedType: &configschema.Object{
Nesting: configschema.Nes
tingMap,
Attributes: map[string]*c
onfigschema.Attribute{
"map": {
NestedTyp
e: &configschema.Object{
N
esting: configschema.NestingList,
A
ttributes: map[string]*configschema.Attribute{
"foo": {
Type: cty.String,
},
}
,
},
Optional:
true,
},
},
},
Optional: true,
},
},
},
cty.NullVal(cty.Object(map[string]cty.Type{
"single": cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]ct
y.Type{
"foo": cty.String,
})),
}),
"map": cty.Map(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]ct
y.Type{
"foo": cty.String,
})),
})),
})),
cty.ObjectVal(map[string]cty.Value{
"single": cty.ObjectVal(map[string]cty.Value{
"list": cty.ListVal([]cty.Value{
cty.ObjectVal(map[string]cty.Valu
e{
"foo": cty.StringVal("a")
,
}),
cty.ObjectVal(map[string]cty.Valu
e{
"foo": cty.StringVal("b")
,
}),
}),
}),
"map": cty.MapVal(map[string]cty.Value{
"one": cty.ObjectVal(map[string]cty.Value
{
"list": cty.ListVal([]cty.Value{
cty.ObjectVal(map[string]
cty.Value{
"foo": cty.String
Val("a"),
}),
cty.ObjectVal(map[string]
cty.Value{
"foo": cty.String
Val("b"),
}),
}),
}),
}),
}),
cty.ObjectVal(map[string]cty.Value{
"single": cty.ObjectVal(map[string]cty.Value{
"list": cty.ListVal([]cty.Value{
cty.ObjectVal(map[string]cty.Valu
e{
"foo": cty.StringVal("a")
,
}),
cty.ObjectVal(map[string]cty.Valu
e{
"foo": cty.StringVal("b")
,
}),
}),
}),
"map": cty.MapVal(map[string]cty.Value{
"one": cty.ObjectVal(map[string]cty.Value
{
"list": cty.ListVal([]cty.Value{
cty.ObjectVal(map[string]
cty.Value{
"foo": cty.String
Val("a"),
}),
cty.ObjectVal(map[string]
cty.Value{
"foo": cty.String
Val("b"),
}),
}),
}),
}),
}),
},
// data sources are planned with an unknown value
"unknown prior nested objects": {
&configschema.Block{
Attributes: map[string]*configschema.Attribute{
"list": {
NestedType: &configschema.Object{
Nesting: configschema.Nes
tingList,
Attributes: map[string]*c
onfigschema.Attribute{
"list": {
NestedTyp
e: &configschema.Object{
N
esting: configschema.NestingList,
A
ttributes: map[string]*configschema.Attribute{
"foo": {
Type: cty.String,
},
}
,
},
Computed:
true,
},
},
},
Computed: true,
},
},
},
cty.UnknownVal(cty.Object(map[string]cty.Type{
"List": cty.List(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]ct
y.Type{
"foo": cty.String,
})),
})),
})),
cty.NullVal(cty.Object(map[string]cty.Type{
"List": cty.List(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]ct
y.Type{
"foo": cty.String,
})),
})),
})),
cty.UnknownVal(cty.Object(map[string]cty.Type{
"List": cty.List(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]ct
y.Type{
"foo": cty.String,
})),
})),
})),
},
} }
for name, test := range tests { for name, test := range tests {
t.Run(name, func(t *testing.T) { t.Run(name, func(t *testing.T) {
got := ProposedNew(test.Schema, test.Prior, test.Config) got := ProposedNew(test.Schema, test.Prior, test.Config)
if !got.RawEquals(test.Want) { if !got.RawEquals(test.Want) {
t.Errorf("wrong result\ngot: %swant: %s", dump.V alue(got), dump.Value(test.Want)) t.Errorf("wrong result\ngot: %swant: %s", dump.V alue(got), dump.Value(test.Want))
} }
}) })
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 205 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)