@@ -335,6 +335,28 @@ func TestConfigGetAttribute(t *testing.T) {
335
335
expected : & testtypes.String {String : types.String {Value : "namevalue" }, CreatedBy : testtypes.StringTypeWithValidateWarning {}},
336
336
expectedDiags : diag.Diagnostics {testtypes .TestWarningDiagnostic (tftypes .NewAttributePath ().WithAttributeName ("name" ))},
337
337
},
338
+ "Computed-Computed-object" : {
339
+ config : Config {
340
+ Raw : tftypes .NewValue (tftypes.Object {
341
+ AttributeTypes : map [string ]tftypes.Type {
342
+ "name" : tftypes .String ,
343
+ },
344
+ }, map [string ]tftypes.Value {
345
+ "name" : tftypes .NewValue (tftypes .String , "namevalue" ),
346
+ }),
347
+ Schema : Schema {
348
+ Attributes : map [string ]Attribute {
349
+ "name" : {
350
+ Type : testtypes.StringTypeWithValidateWarning {},
351
+ Required : true ,
352
+ },
353
+ },
354
+ },
355
+ },
356
+ target : new (testtypes.String ),
357
+ expected : & testtypes.String {String : types.String {Value : "namevalue" }, CreatedBy : testtypes.StringTypeWithValidateWarning {}},
358
+ expectedDiags : diag.Diagnostics {testtypes .TestWarningDiagnostic (tftypes .NewAttributePath ().WithAttributeName ("name" ))},
359
+ },
338
360
}
339
361
340
362
for name , tc := range testCases {
@@ -1585,6 +1607,35 @@ func TestConfigGetAttributeValue(t *testing.T) {
1585
1607
expected : testtypes.String {String : types.String {Value : "value" }, CreatedBy : testtypes.StringTypeWithValidateWarning {}},
1586
1608
expectedDiags : diag.Diagnostics {testtypes .TestWarningDiagnostic (tftypes .NewAttributePath ().WithAttributeName ("test" ))},
1587
1609
},
1610
+ "AttrTypeInt64WithValidateError-nested-missing-in-config" : {
1611
+ config : Config {
1612
+ Raw : tftypes .NewValue (tftypes.Object {
1613
+ AttributeTypes : map [string ]tftypes.Type {
1614
+ "parent" : tftypes.Object {},
1615
+ },
1616
+ }, map [string ]tftypes.Value {
1617
+ "parent" : tftypes .NewValue (tftypes.Object {}, nil ),
1618
+ }),
1619
+ Schema : Schema {
1620
+ Attributes : map [string ]Attribute {
1621
+ "parent" : {
1622
+ Attributes : SingleNestedAttributes (map [string ]Attribute {
1623
+ "test" : {
1624
+ Type : types .Int64Type ,
1625
+ Optional : true ,
1626
+ Computed : true ,
1627
+ },
1628
+ }),
1629
+ Computed : true ,
1630
+ Optional : true ,
1631
+ },
1632
+ },
1633
+ },
1634
+ },
1635
+ path : tftypes .NewAttributePath ().WithAttributeName ("parent" ).WithAttributeName ("test" ),
1636
+ expected : types.Int64 {Null : true },
1637
+ expectedDiags : nil ,
1638
+ },
1588
1639
}
1589
1640
1590
1641
for name , tc := range testCases {
0 commit comments