mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-14 06:39:07 -04:00
29 lines
1.0 KiB
Go
29 lines
1.0 KiB
Go
package parity
|
|
|
|
import (
|
|
"github.com/opencloud-eu/opencloud/services/search/pkg/search"
|
|
)
|
|
|
|
func pathGroup() queryGroup {
|
|
return queryGroup{
|
|
name: "path",
|
|
fixtures: []search.Resource{
|
|
fixtureFolder("parent"),
|
|
fixtureDoc("child.jpg", withMime("image/jpeg"), withPath("./parent/child.jpg")),
|
|
fixtureFolder("docs-lower", withPath("./documents")),
|
|
fixtureFolder("docs-upper", withPath("./DOCUMENTS")),
|
|
fixtureFolder("docs-mixed", withPath("./Documents")),
|
|
},
|
|
cases: []queryCase{
|
|
{id: 1, query: `path:"./parent"`, want: []string{"parent", "child.jpg"}},
|
|
{id: 2, query: `path:"./parent/child.jpg"`, want: []string{"child.jpg"}},
|
|
{id: 3, query: `path:"./Parent"`},
|
|
{id: 4, query: `path:"*child*"`, want: []string{"child.jpg"}},
|
|
{id: 5, query: `path:"./documents"`, want: []string{"docs-lower"}},
|
|
{id: 6, query: `path:"./DOCUMENTS"`, want: []string{"docs-upper"}},
|
|
{id: 7, query: `path:"./Documents"`, want: []string{"docs-mixed"}},
|
|
{id: 8, query: `path:"./parent/"`, want: []string{"parent", "child.jpg"}},
|
|
},
|
|
}
|
|
}
|