From c470395b7a8953bfd745caefdbbd6929b6d723d7 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 4 Nov 2024 13:15:22 -0500 Subject: [PATCH] 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. --- datasource/http/data_acc_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasource/http/data_acc_test.go b/datasource/http/data_acc_test.go index 57d45bc7922..25754488b84 100644 --- a/datasource/http/data_acc_test.go +++ b/datasource/http/data_acc_test.go @@ -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\\]", }, }, {