mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-18 18:29:44 -05:00
don't explicitly specify defaults in argument parsing
This commit is contained in:
parent
3dbfbe5dc9
commit
da74b59ea1
1 changed files with 4 additions and 18 deletions
|
|
@ -16,34 +16,24 @@ func TestParseStateList_valid(t *testing.T) {
|
|||
}{
|
||||
"defaults": {
|
||||
nil,
|
||||
&StateList{
|
||||
StatePath: "",
|
||||
ID: "",
|
||||
Addrs: nil,
|
||||
},
|
||||
&StateList{},
|
||||
},
|
||||
"state path": {
|
||||
[]string{"-state=foobar.tfstate"},
|
||||
&StateList{
|
||||
StatePath: "foobar.tfstate",
|
||||
ID: "",
|
||||
Addrs: nil,
|
||||
},
|
||||
},
|
||||
"id filter": {
|
||||
[]string{"-id=bar"},
|
||||
&StateList{
|
||||
StatePath: "",
|
||||
ID: "bar",
|
||||
Addrs: nil,
|
||||
ID: "bar",
|
||||
},
|
||||
},
|
||||
"with addresses": {
|
||||
[]string{"module.example", "aws_instance.foo"},
|
||||
&StateList{
|
||||
StatePath: "",
|
||||
ID: "",
|
||||
Addrs: []string{"module.example", "aws_instance.foo"},
|
||||
Addrs: []string{"module.example", "aws_instance.foo"},
|
||||
},
|
||||
},
|
||||
"all options": {
|
||||
|
|
@ -88,11 +78,7 @@ func TestParseStateList_invalid(t *testing.T) {
|
|||
}{
|
||||
"unknown flag": {
|
||||
[]string{"-boop"},
|
||||
&StateList{
|
||||
StatePath: "",
|
||||
ID: "",
|
||||
Addrs: nil,
|
||||
},
|
||||
&StateList{},
|
||||
tfdiags.Diagnostics{
|
||||
tfdiags.Sourceless(
|
||||
tfdiags.Error,
|
||||
|
|
|
|||
Loading…
Reference in a new issue