From 66d685830373c716fdf740c3373706056b93ad65 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Thu, 2 Mar 2023 20:00:11 +0000 Subject: use common shell quoting utility * only suited for printable ascii * always single-quotes if quoting needed * may quote more than strictly necessary --- client/go/internal/curl/curl_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/go/internal/curl/curl_test.go') diff --git a/client/go/internal/curl/curl_test.go b/client/go/internal/curl/curl_test.go index 448e1e5199f..a8ccade3866 100644 --- a/client/go/internal/curl/curl_test.go +++ b/client/go/internal/curl/curl_test.go @@ -17,7 +17,7 @@ func TestPost(t *testing.T) { c.WithBodyFile("file.json") c.Header("Content-Type", "application/json") - assert.Equal(t, "curl --key key.pem --cert cert.pem -X POST -H 'Content-Type: application/json' --data-binary @file.json https://example.com", c.String()) + assert.Equal(t, "curl --key key.pem --cert cert.pem -X POST -H 'Content-Type: application/json' --data-binary '@file.json' https://example.com", c.String()) } func TestGet(t *testing.T) { @@ -30,7 +30,7 @@ func TestGet(t *testing.T) { c.Param("yql", "select * from sources * where title contains 'foo';") c.Param("hits", "5") - assert.Equal(t, `curl --key key.pem --cert cert.pem https://example.com\?hits=5\&yql=select+%2A+from+sources+%2A+where+title+contains+%27foo%27%3B`, c.String()) + assert.Equal(t, `curl --key key.pem --cert cert.pem 'https://example.com?hits=5&yql=select+%2A+from+sources+%2A+where+title+contains+%27foo%27%3B'`, c.String()) } func TestRawArgs(t *testing.T) { -- cgit v1.2.3