mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
added use cases
This commit is contained in:
parent
aea45de290
commit
5c9a332ad6
@ -132,7 +132,7 @@ func TestTest(t *testing.T) {
|
|||||||
expected: "1 passed, 0 failed.",
|
expected: "1 passed, 0 failed.",
|
||||||
code: 0,
|
code: 0,
|
||||||
},
|
},
|
||||||
"broken_no_hcl": {
|
"broken_no_valid_hcl": {
|
||||||
expected: "Unsupported block type",
|
expected: "Unsupported block type",
|
||||||
code: 1,
|
code: 1,
|
||||||
},
|
},
|
||||||
@ -187,11 +187,14 @@ func TestTest_Broken_HCL_Files(t *testing.T) {
|
|||||||
code int
|
code int
|
||||||
skip bool
|
skip bool
|
||||||
}{
|
}{
|
||||||
|
"broken_no_valid_hcl": {
|
||||||
"broken_no_hcl": {
|
|
||||||
expected: "Unsupported block type",
|
expected: "Unsupported block type",
|
||||||
code: 1,
|
code: 1,
|
||||||
},
|
},
|
||||||
|
"broken_wrong_block_resource": {
|
||||||
|
expected: "Blocks of type \"resource\" are not expected here.",
|
||||||
|
code: 1,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for name, tc := range tcs {
|
for name, tc := range tcs {
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
resource "test_resource" "resource" {
|
resource "test_resource" "resource" {
|
||||||
value = var.input
|
|
||||||
}
|
}
|
2
internal/command/testdata/test/broken_wrong_block_resource/main.tf
vendored
Normal file
2
internal/command/testdata/test/broken_wrong_block_resource/main.tf
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
resource "test_resource" "resource" {
|
||||||
|
}
|
4
internal/command/testdata/test/broken_wrong_block_resource/main.tftest.hcl
vendored
Normal file
4
internal/command/testdata/test/broken_wrong_block_resource/main.tftest.hcl
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
resource "test_resource" "i_cant_write_that_here" {
|
||||||
|
}
|
||||||
|
|
||||||
|
run "test" {}
|
Loading…
Reference in New Issue
Block a user