Skip to content

Commit

Permalink
tests: test setting provider version on function detail
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Feb 14, 2024
1 parent 175ea3b commit 8cecdda
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions schema/provider_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
tfaddr "github.com/hashicorp/terraform-registry-address"
"github.com/zclconf/go-cty-debug/ctydebug"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/function"
)

func TestProviderSchema_SetProviderVersion(t *testing.T) {
Expand All @@ -37,6 +38,18 @@ func TestProviderSchema_SetProviderVersion(t *testing.T) {
},
},
},
Functions: map[string]*schema.FunctionSignature{
"baz": {
Params: []function.Parameter{
{
Name: "a",
Type: cty.String,
Description: "first parameter",
},
},
Description: "baz",
},
},
}
expectedSchema := &ProviderSchema{
Provider: &schema.BodySchema{
Expand Down Expand Up @@ -69,6 +82,15 @@ func TestProviderSchema_SetProviderVersion(t *testing.T) {
},
},
},
Functions: map[string]*schema.FunctionSignature{
"baz": {
Description: "baz",
Detail: "hashicorp/aws 1.2.5",
Params: []function.Parameter{
{Name: "a", Type: cty.String, Description: "first parameter"},
},
},
},
}

pAddr := tfaddr.Provider{
Expand Down

0 comments on commit 8cecdda

Please sign in to comment.