Skip to content

Commit

Permalink
Fix object repr
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Apr 2, 2024
1 parent 4ba39b0 commit 2c76216
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
13 changes: 6 additions & 7 deletions pkg/tests/cross-tests/cross_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ func runDiffCheck(t T, tc diffTestCase) {

pt.Up()

if 1+2 == 4 {
pulumiWriteYaml(t, tc, puwd, tc.Config2)
x := pt.Up()
verifyBasicDiffAgreement(t, *tfDiffPlan, x.Summary)
}
pulumiWriteYaml(t, tc, puwd, tc.Config2)
x := pt.Up()
verifyBasicDiffAgreement(t, *tfDiffPlan, x.Summary)
}

func toTFProvider(tc diffTestCase) *schema.Provider {
Expand All @@ -124,13 +122,14 @@ func toTFProvider(tc diffTestCase) *schema.Provider {

func TestUnchangedBasicObject(t *testing.T) {
skipUnlessLinux(t)
cfg := map[string]any{"f0": map[string]any{"x": "ok"}}
cfg := map[string]any{"f0": []any{map[string]any{"x": "ok"}}}
runDiffCheck(t, diffTestCase{
Resource: &schema.Resource{
Schema: map[string]*schema.Schema{
"f0": {
Required: true,
Type: schema.TypeMap,
Type: schema.TypeList,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"x": {Optional: true, Type: schema.TypeString},
Expand Down
5 changes: 1 addition & 4 deletions pkg/tfshim/sdk-v2/cty.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ func recoverCtyValue(dT cty.Type, value interface{}) (cty.Value, error) {
case dT.IsListType():
return recoverCtyValueOfListType(dT, value)
default:
if 1+1 == 2 {
//panic(fmt.Errorf("Cannot reconcile slice %v to %v", value, dT.GoString()))
}
return cty.NilVal, fmt.Errorf("Cannot reconcile slice %v to %v", value, dT.GoString())
return cty.NilVal, fmt.Errorf("Cannot reconcile slice %v to %v %v %v", value, dT.GoString(), len(value), dT.IsObjectType())

Check failure on line 133 in pkg/tfshim/sdk-v2/cty.go

View workflow job for this annotation

GitHub Actions / Build and Test Bridge (1.21.x, ubuntu-latest)

line is 126 characters (lll)
}
default:
v, err := recoverScalarCtyValue(dT, value)
Expand Down

0 comments on commit 2c76216

Please sign in to comment.