Skip to content

Commit

Permalink
unit test StateReplaceProviderAction
Browse files Browse the repository at this point in the history
  • Loading branch information
mdb committed Aug 24, 2023
1 parent 64b3a3a commit d522a4b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tfmigrate/state_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,33 @@ func TestNewStateActionFromString(t *testing.T) {
want: nil,
ok: false,
},
{
desc: "replace-provider action (0 args)",
cmdStr: "replace-provider",
want: nil,
ok: false,
},
{
desc: "replace-provider action (1 args)",
cmdStr: "replace-provider registry.terraform.io/hashicorp/null",
want: nil,
ok: false,
},
{
desc: "replace-provider action (valid)",
cmdStr: "replace-provider registry.terraform.io/hashicorp/null registry.tfmigrate.io/hashicorp/null",
want: &StateReplaceProviderAction{
source: "registry.terraform.io/hashicorp/null",
destination: "registry.tfmigrate.io/hashicorp/null",
},
ok: true,
},
{
desc: "replace-provider action (3 args)",
cmdStr: "replace-provider registry.terraform.io/hashicorp/null registry.tfmigrate.io/hashicorp/null registry.tfmigrate.io/hashicorp/null",
want: nil,
ok: false,
},
{
desc: "xmv action (valid)",
cmdStr: "xmv null_resource.* null_resource.$1",
Expand Down

0 comments on commit d522a4b

Please sign in to comment.