carddav: don't filter properties in test queries

As is, the tests in `match_test.go` test wrong behavior. They request
"partial retrieval" (i.e. filtering of returned properties), but compare
the returned result to the original input. They essentially rely on the
fact that property filtering is currently not implemented.

To fix this, simply make all existing test queries request all
properties. If property filtering gets implemented (correctly), the
tests will then continue to work. New tests can be added for testing
the property filtering itself.
This commit is contained in:
Conrad Hoffmann 2022-05-19 14:06:15 +02:00 committed by Simon Ser
parent d7891ce50c
commit 21aea26c70

View File

@ -64,11 +64,7 @@ END:VCARD`)
name: "no-limit-query", name: "no-limit-query",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
PropFilters: []PropFilter{ PropFilters: []PropFilter{
{ {
@ -84,11 +80,7 @@ END:VCARD`)
name: "limit-1-query", name: "limit-1-query",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
Limit: 1, Limit: 1,
PropFilters: []PropFilter{ PropFilters: []PropFilter{
@ -105,11 +97,7 @@ END:VCARD`)
name: "limit-4-query", name: "limit-4-query",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
Limit: 4, Limit: 4,
PropFilters: []PropFilter{ PropFilters: []PropFilter{
@ -126,11 +114,7 @@ END:VCARD`)
name: "email-match", name: "email-match",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
PropFilters: []PropFilter{ PropFilters: []PropFilter{
{ {
@ -146,11 +130,7 @@ END:VCARD`)
name: "email-match-any", name: "email-match-any",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
PropFilters: []PropFilter{ PropFilters: []PropFilter{
{ {
@ -169,11 +149,7 @@ END:VCARD`)
name: "email-match-all", name: "email-match-all",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
PropFilters: []PropFilter{{ PropFilters: []PropFilter{{
Name: vcard.FieldEmail, Name: vcard.FieldEmail,
@ -189,11 +165,7 @@ END:VCARD`)
name: "email-no-match", name: "email-no-match",
query: &AddressBookQuery{ query: &AddressBookQuery{
DataRequest: AddressDataRequest{ DataRequest: AddressDataRequest{
Props: []string{ AllProp: true,
vcard.FieldFormattedName,
vcard.FieldEmail,
vcard.FieldUID,
},
}, },
PropFilters: []PropFilter{ PropFilters: []PropFilter{
{ {