chore: refactor tests
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 14s
CI Workflow / CI (pull_request) Failing after 12m47s
CI Workflow / Code coverage report (pull_request) Has been skipped
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 30m54s
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 14s
CI Workflow / CI (pull_request) Failing after 12m47s
CI Workflow / Code coverage report (pull_request) Has been skipped
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 30m54s
This commit is contained in:
parent
d6627617af
commit
ca2a261514
15 changed files with 1088 additions and 294 deletions
|
|
@ -1,50 +0,0 @@
|
|||
// Copyright (c) STACKIT
|
||||
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-testing/config"
|
||||
)
|
||||
|
||||
func TestConvertConfigVariable(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
variable config.Variable
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "string",
|
||||
variable: config.StringVariable("test"),
|
||||
want: "test",
|
||||
},
|
||||
{
|
||||
name: "bool: true",
|
||||
variable: config.BoolVariable(true),
|
||||
want: "true",
|
||||
},
|
||||
{
|
||||
name: "bool: false",
|
||||
variable: config.BoolVariable(false),
|
||||
want: "false",
|
||||
},
|
||||
{
|
||||
name: "integer",
|
||||
variable: config.IntegerVariable(10),
|
||||
want: "10",
|
||||
},
|
||||
{
|
||||
name: "quoted string",
|
||||
variable: config.StringVariable(`instance =~ ".*"`),
|
||||
want: `instance =~ ".*"`,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := ConvertConfigVariable(tt.variable); got != tt.want {
|
||||
t.Errorf("ConvertConfigVariable() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue