You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/internal/lang/functions_descriptions_test.go

28 lines
671 B

package lang
import (
"testing"
"github.com/hashicorp/terraform/internal/lang/funcs"
)
func TestFunctionDescriptions(t *testing.T) {
scope := &Scope{
ConsoleMode: true,
}
// This will implicitly test the parameter description count since
// WithNewDescriptions will panic if the number doesn't match.
allFunctions := scope.Functions()
if len(allFunctions) != len(funcs.DescriptionList) {
t.Errorf("DescriptionList length expected: %d, got %d", len(allFunctions), len(funcs.DescriptionList))
}
for name := range allFunctions {
_, ok := funcs.DescriptionList[name]
if !ok {
t.Errorf("missing DescriptionList entry for function %q", name)
}
}
}