mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-14 06:39:07 -04:00
test(search): comment the root-id assumption, pin the OR fan-out
This commit is contained in:
1 parent
8e68a34b8f
commit
2041fdc259
2 files changed
+13
-1
No files matched your search
@@ -226,7 +226,9 @@ func convertToWebDAVPermissions(isShared, isMountpoint, isDir bool, p *provider.
|
||||
}
|
||||
|
||||
// CompleteRootID completes a bare driveId ("storage$space") to the root
|
||||
// resource id stored in the index; a root's opaque id is its space id.
|
||||
// resource id stored in the index. Assumes a space root's opaque id equals
|
||||
// its space id (true for decomposedfs); elsewhere a bare driveId matches
|
||||
// nothing, the pinning stays safe either way.
|
||||
func CompleteRootID(v string) string {
|
||||
// leave wildcards alone, "1$*!*" would match nothing
|
||||
if strings.Contains(v, "!") || strings.ContainsAny(v, "*?") {
|
||||
|
||||
@@ -509,6 +509,16 @@ var _ = Describe("Searchprovider", func() {
|
||||
indexClient.AssertNumberOfCalls(GinkgoT(), "Search", 1)
|
||||
})
|
||||
|
||||
It("keeps the full fan-out for an OR query", func() {
|
||||
res, err := s.Search(ctx, &searchsvc.SearchRequest{
|
||||
Query: `driveId:"storageid$personalspace" OR foo`,
|
||||
})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(res).ToNot(BeNil())
|
||||
Expect(len(res.Matches)).To(Equal(3))
|
||||
indexClient.AssertNumberOfCalls(GinkgoT(), "Search", 2)
|
||||
})
|
||||
|
||||
It("considers the search Ref parameter", func() {
|
||||
res, err := s.Search(ctx, &searchsvc.SearchRequest{
|
||||
Query: "foo",
|
||||
|
||||
Reference in new issue
Block a user