Skip to content

Commit

Permalink
Add tests for parsing multi_state xmv actions
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Dec 26, 2022
1 parent b61b5de commit 39af101
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tfmigrate/multi_state_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,33 @@ func TestNewMultiStateActionFromString(t *testing.T) {
want: nil,
ok: false,
},
{
desc: "xmv action (valid)",
cmdStr: "xmv null_resource.* null_resource.$1",
want: &MultiStateXmvAction{
source: "null_resource.*",
destination: "null_resource.$1",
},
ok: true,
},
{
desc: "xmv action (no args)",
cmdStr: "xmv",
want: nil,
ok: false,
},
{
desc: "xmv action (1 arg)",
cmdStr: "xmv null_resource.foo",
want: nil,
ok: false,
},
{
desc: "xmv action (3 args)",
cmdStr: "xmv null_resource.foo null_resource.foo2 null_resource.foo3",
want: nil,
ok: false,
},
{
desc: "duplicated white spaces",
cmdStr: " mv null_resource.foo null_resource.foo2 ",
Expand Down

0 comments on commit 39af101

Please sign in to comment.