mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
Fix ListObjectParts to list properly all parts - closes #4322
This commit is contained in:
committed by
Harshavardhana
parent
52122c0309
commit
9c50a9f567
@@ -18,6 +18,41 @@ package cmd
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEscape(t *testing.T) {
|
||||
testCases := []struct {
|
||||
Value string
|
||||
EscapedValue string
|
||||
}{
|
||||
{
|
||||
Value: "test-test",
|
||||
EscapedValue: "test%2Dtest",
|
||||
},
|
||||
{
|
||||
Value: "test/test",
|
||||
EscapedValue: "test%2Ftest",
|
||||
},
|
||||
{
|
||||
Value: "test%test",
|
||||
EscapedValue: "test%25test",
|
||||
},
|
||||
{
|
||||
Value: "%%%////+++",
|
||||
EscapedValue: "%25%25%25%2F%2F%2F%2F+++",
|
||||
},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
if escape(testCase.Value) != testCase.EscapedValue {
|
||||
t.Errorf("Test %d: Expected %s, got %s", i+1, testCase.EscapedValue, escape(testCase.Value))
|
||||
}
|
||||
|
||||
if unescape(testCase.EscapedValue) != testCase.Value {
|
||||
t.Errorf("Test %d: Expected %s, got %s", i+1, testCase.Value, unescape(testCase.EscapedValue))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestToGCSPageToken(t *testing.T) {
|
||||
testCases := []struct {
|
||||
Name string
|
||||
|
||||
Reference in New Issue
Block a user