-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from go-kivik/plussign-v3
Support + characters in doc IDs properly
- Loading branch information
Showing
8 changed files
with
83 additions
and
19 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
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package chttp | ||
|
||
import "testing" | ||
import ( | ||
"testing" | ||
) | ||
|
||
func TestEncodeDocID(t *testing.T) { | ||
tests := []struct { | ||
|
@@ -11,12 +13,12 @@ func TestEncodeDocID(t *testing.T) { | |
{Input: "foo/bar", Expected: "foo%2Fbar"}, | ||
{Input: "_design/foo", Expected: "_design/foo"}, | ||
{Input: "_design/foo/bar", Expected: "_design/foo%2Fbar"}, | ||
{Input: "[email protected]", Expected: "foo@bar.com"}, | ||
{Input: "[email protected]", Expected: "foo+bar@baz.com"}, | ||
{Input: "[email protected]", Expected: "foo%40bar.com"}, | ||
{Input: "[email protected]", Expected: "foo%2Bbar%40baz.com"}, | ||
{Input: "Is this a valid ID?", Expected: "Is%20this%20a%20valid%20ID%3F"}, | ||
{Input: "nón-English-çharacters", Expected: "n%C3%B3n-English-%C3%A7haracters"}, | ||
{Input: "foo+bar & páces?!*,", Expected: "foo+bar%20&%20p%C3%A1ces%3F%21%2A%2C"}, | ||
{Input: "kivik$1234", Expected: "kivik$1234"}, | ||
{Input: "foo+bar & páces?!*,", Expected: "foo%2Bbar%20%26%20p%C3%A1ces%3F%21%2A%2C"}, | ||
{Input: "kivik$1234", Expected: "kivik%241234"}, | ||
{Input: "_users", Expected: "_users"}, | ||
} | ||
for _, test := range tests { | ||
|
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
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