aboutsummaryrefslogtreecommitdiff
path: root/test/T610-message-property.sh
AgeCommit message (Collapse)Author
2025-02-22test/message-property: convert python tests from legacy bindingsDavid Bremner
One test is deleted since that method is not provided by the new bindings. Similar things can be done by accessing the PropertiesMap returned by properties. This change is a prelude to removing the legacy bindings from the build.
2023-03-30test: add test for notmuch_message_remove_all_properties_with_prefixKevin Boulain
It wasn't covered, though it shares most of its implementation with notmuch_message_remove_all_properties.
2023-03-30lib/message-property: sync removed properties to the databaseKevin Boulain
_notmuch_message_remove_all_properties wasn't syncing the message back to the database but was still invalidating the metadata, giving the impression the properties had actually been removed. Also move the metadata invalidation to _notmuch_message_remove_terms to be closer to what's done in _notmuch_message_modify_property and _notmuch_message_remove_term.
2023-03-30test: reveal notmuch_message_remove_all_properties as brokenDavid Bremner
Close and re-open the database to show that the removal is not committed to the database.
2023-03-30test: reorganize tests and mark a few of them as brokenKevin Boulain
notmuch_message_remove_all_properties should have removed the testkey1 = testvalue1 property but hasn't. Delay the execution of the corresponding test to avoid updating a few tests that actually relied on the broken behavior.
2023-03-30test: remove unnecessary sortingKevin Boulain
The other tests rely on a stable output.
2023-03-30test: display key name in property testsKevin Boulain
To make the tests a bit easier to understand.
2023-03-30lib/message-property: catch xapian exceptionsKevin Boulain
Since libnotmuch exposes a C interface there's no way for clients to catch this. Inspired by what's done for tags (see notmuch_message_remove_tag).
2023-03-30test: uncaught exception when editing properties of a removed messageKevin Boulain
These two functions don't fail gracefully when editing a removed message: BROKEN edit property on removed message without uncaught exception --- T610-message-property.20.EXPECTED 2023-02-27 11:33:25.792764376 +0000 +++ T610-message-property.20.OUTPUT 2023-02-27 11:33:25.793764381 +0000 @@ -1,2 +1,3 @@ == stdout == == stderr == +terminate called after throwing an instance of 'Xapian::DocNotFoundError' The other functions appear to be safe.
2022-05-29test: replace deprecated use of notmuch_database_openDavid Bremner
This is a bit more involved than replacing the use of notmuch_database_open_verbose, as we have to effectively inline the definition of notmuch_database_open.
2021-12-04test: move system includes to notmuch-test.hDavid Bremner
This removes some redudant includes, and will also make it easier to introduce "#define _GNU_SOURCE", which must come before all system includes.
2020-08-09Fix typosJonas Bernoulli
2020-04-23test: sort the output of the "prefix" test in T610-message-propertyOlivier Taïbi
This test extracts values from a (key,value) map where multiple entries can have the same key, and the entries are sorted by key, but not by value. The test incorrectly assumes that the values will be sorted as well, so sort the output.
2019-03-05lib/string_map: fix return type of string_cmpDavid Bremner
I can't figure out how checking the sign of a bool ever worked. The following program demonstrates the problem (i.e. for me it prints 1). #include <stdio.h> #include <stdbool.h> int main(int argc, char **argv) { bool x; x = -1; printf("x = %d\n", x); } This seems to be mandated by the C99 standard 6.3.1.2.
2019-03-05lib: Add known broken test for string_map binary search.David Bremner
Because the string_map functions are not exported, we test via message properties.
2018-05-02test: tests for python bindings get_property / get_propertiesDavid Bremner
These roughly replicate the equivalent C tests, although they rely on the database state created by the former tests, since the python bindings currently provide read-only access to properties.
2017-10-20test: use $(dirname "$0") for sourcing test-lib.shJani Nikula
Don't assume the tests are always run from within the source tree.
2017-06-01cli/dump: don't include tags when not asked forDavid Bremner
Add in the analogous test for tags that is given for properties a few lines below.
2017-06-01test: add known broken test --include=propertiesDavid Bremner
Reported in [1], --include=properties currently implies --include=tags, but it should not. [1] id:87y3u8vjbo.fsf@tethera.net
2016-09-21add property: query prefix to search for specific propertiesDaniel Kahn Gillmor
We want to be able to query the properties directly, like: notmuch count property:foo=bar which should return a count of messages where the property with key "foo" has value equal to "bar".
2016-09-21cli: optionally restore message properties from dump fileDavid Bremner
This somewhat mimics the config line parsing, except there can be arbitrarily many key value pairs, so one more level of looping is required.
2016-09-21CLI: add properties to dump outputDavid Bremner
Part of providing extensibility via properties is to make sure that user data is not lost. Thus we need to be able to dump and restore properties.
2016-09-21lib: iterator API for message propertiesDavid Bremner
This is a thin wrapper around the string map iterator API just introduced.
2016-09-21lib: basic message-property APIDavid Bremner
Initially, support get, set and removal of single key/value pair, as well as removing all properties.