Skip to content

Commit

Permalink
datasource: fix test for invalid method
Browse files Browse the repository at this point in the history
Since the expected error to look for in the output is compiled to a
regexp, the `[]` from the error message were interpreted as a set of
characters, which made the regexp not match the expected output from the
command.
So to avoid this problem, we escape them so they are expected verbatim
in the command output.
  • Loading branch information
lbajolet-hashicorp committed Nov 4, 2024
1 parent 6c40bfb commit c470395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasource/http/data_acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestHttpDataSource(t *testing.T) {
Path: testDatasourceInvalidMethod,
Error: true,
Outputs: map[string]string{
"error": "the `method` must be one of [HEAD GET POST PUT DELETE OPTIONS PATCH]",
"error": "the `method` must be one of \\[HEAD GET POST PUT DELETE OPTIONS PATCH\\]",
},
},
{
Expand Down

0 comments on commit c470395

Please sign in to comment.