generated from cloudwego/.github
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc62cee
commit ac162ef
Showing
6 changed files
with
78 additions
and
38 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package easy_http | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestSetQueryParam(t *testing.T) { | ||
c := MustNew() | ||
c.SetQueryParam("test1", "test1") | ||
c.SetQueryParams(map[string]string{"test2": "test2", "test3": "test3"}) | ||
c.SetQueryParamsFromValues(map[string][]string{"test4": {"test41", "test42"}}) | ||
c.SetQueryString("test5=test5") | ||
|
||
assert.Equal(t, "test1", c.QueryParam.Get("test1")) | ||
assert.Equal(t, "test2", c.QueryParam.Get("test2")) | ||
assert.Equal(t, "test3", c.QueryParam.Get("test3")) | ||
assert.Equal(t, []string{"test41", "test42"}, c.QueryParam["test4"]) | ||
assert.Equal(t, "test5", c.QueryParam.Get("test5")) | ||
} |
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 @@ | ||
package easy_http |
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