Skip to content

Commit b523826

Browse files
committed
Added test for pathEscape
1 parent 541bb95 commit b523826

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

encode_test.go

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
// Author Ewout Prangsma
21+
//
22+
23+
package driver
24+
25+
import "testing"
26+
27+
func TestPathEscape(t *testing.T) {
28+
tests := map[string]string{ // Input : Expected-Output
29+
"abc": "abc",
30+
"The Donald": "The%20Donald",
31+
}
32+
for input, expected := range tests {
33+
result := pathEscape(input)
34+
if result != expected {
35+
t.Errorf("pathEscapse failed for '%s': Expected '%s', got '%s'", input, expected, result)
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)