Skip to content

Commit

Permalink
remove conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonaj committed Apr 6, 2023
1 parent 5404375 commit 5c81f2c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
12 changes: 0 additions & 12 deletions internal/flex/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,6 @@ func FlattenFrameworkStringValueSetLegacy(_ context.Context, vs []string) types.
return types.SetValueMust(types.StringType, elems)
}

// FlattenFrameworkStringSetLegacy is the Plugin Framework variant of FlattenStringSet.
// A nil slice is converted to an empty (non-null) Set.
func FlattenFrameworkStringSetLegacy(_ context.Context, vs []*string) types.Set {
elems := make([]attr.Value, len(vs))

for i, v := range vs {
elems[i] = types.StringValue(aws.ToString(v))
}

return types.SetValueMust(types.StringType, elems)
}

// FlattenFrameworkStringValueMapLegacy has no Plugin SDK equivalent as schema.ResourceData.Set can be passed string value maps directly.
// A nil map is converted to an empty (non-null) Map.
func FlattenFrameworkStringValueMapLegacy(_ context.Context, m map[string]string) types.Map {
Expand Down
39 changes: 0 additions & 39 deletions internal/flex/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,45 +493,6 @@ func TestFlattenFrameworkStringValueSetLegacy(t *testing.T) {
}
}

func TestFlattenFrameworkStringSetLegacy(t *testing.T) {
t.Parallel()

type testCase struct {
input []*string
expected types.Set
}
tests := map[string]testCase{
"two elements": {
input: []*string{aws.String("GET"), aws.String("HEAD")},
expected: types.SetValueMust(types.StringType, []attr.Value{
types.StringValue("GET"),
types.StringValue("HEAD"),
}),
},
"zero elements": {
input: []*string{},
expected: types.SetValueMust(types.StringType, []attr.Value{}),
},
"nil array": {
input: nil,
expected: types.SetValueMust(types.StringType, []attr.Value{}),
},
}

for name, test := range tests {
name, test := name, test
t.Run(name, func(t *testing.T) {
t.Parallel()

got := FlattenFrameworkStringSetLegacy(context.Background(), test.input)

if diff := cmp.Diff(got, test.expected); diff != "" {
t.Errorf("unexpected diff (+wanted, -got): %s", diff)
}
})
}
}

func TestFlattenFrameworkStringValueMapLegacy(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 5c81f2c

Please sign in to comment.