-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(googleapi): support setting arbitrary query parameters (#1123)
Fixes: #550
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2021 Google LLC. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package gensupport | ||
|
||
import ( | ||
"testing" | ||
|
||
"google.golang.org/api/googleapi" | ||
) | ||
|
||
func TestSetOptionsGetMulti(t *testing.T) { | ||
co := googleapi.QueryParameter("key", "foo", "bar") | ||
urlParams := make(URLParams) | ||
SetOptions(urlParams, co) | ||
if got, want := urlParams.Encode(), "key=foo&key=bar"; got != want { | ||
t.Fatalf("URLParams.Encode() = %q, want %q", got, want) | ||
} | ||
} |