datasource: fix test for invalid method

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.
pull/13203/head
Lucas Bajolet 1 year ago committed by Lucas Bajolet
parent 6c40bfb0cd
commit c470395b7a

@ -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\\]",
},
},
{

Loading…
Cancel
Save