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