Add API tests for both donut on disk and donut cache

This commit is contained in:
Harshavardhana
2015-07-07 19:37:16 -07:00
parent c76d4f6cdd
commit d1deda3a96
7 changed files with 1068 additions and 147 deletions

View File

@@ -500,13 +500,12 @@ func (donut API) ListObjects(bucket string, resources BucketResourcesMetadata) (
}
var prefixes []string
var filteredKeys []string
filteredKeys = keys
if strings.TrimSpace(resources.Delimiter) != "" {
filteredKeys = HasNoDelimiter(keys, resources.Delimiter)
prefixes = HasDelimiter(keys, resources.Delimiter)
prefixes = SplitDelimiter(prefixes, resources.Delimiter)
prefixes = SortU(prefixes)
} else {
filteredKeys = keys
}
for _, commonPrefix := range prefixes {
resources.CommonPrefixes = append(resources.CommonPrefixes, resources.Prefix+commonPrefix)