diff options
author | Andre Heinecke <[email protected]> | 2018-11-14 13:57:40 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-11-14 13:57:40 +0000 |
commit | 9a31fdcb11d04d47dfcc38a8409b84436c549108 (patch) | |
tree | 19c1880c2acdb73821bfadbf37db6e1ebce0b869 /tests/json | |
parent | tests,json: Skip tests for older GnuPG versions (diff) | |
download | gpgme-9a31fdcb11d04d47dfcc38a8409b84436c549108.tar.gz gpgme-9a31fdcb11d04d47dfcc38a8409b84436c549108.zip |
tests,json: Add wildcard string matching
* tests/json/t-json.c (test_contains): When searching for "*" accept
every string.
--
This allows it to write tests that check for the existence of
a string value but don't care about the contents. E.g. for Data.
Diffstat (limited to 'tests/json')
-rw-r--r-- | tests/json/t-json.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/json/t-json.c b/tests/json/t-json.c index 07b99847..f5b27939 100644 --- a/tests/json/t-json.c +++ b/tests/json/t-json.c @@ -125,7 +125,9 @@ test_contains (cjson_t needle, cjson_t hay) } if (cjson_is_string (needle)) { - if (strcmp (needle->valuestring, hay->valuestring)) + if (strcmp (needle->valuestring, hay->valuestring) && + /* Use * as a general don't care placeholder */ + strcmp (needle->valuestring, "*")) { if (verbose) fprintf (stderr, "%s: string mismatch Expected '%s' got '%s'\n", |