diff options
Diffstat (limited to 'tests/clar.c')
-rw-r--r-- | tests/clar.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/clar.c b/tests/clar.c index ead13f46a..69283b86b 100644 --- a/tests/clar.c +++ b/tests/clar.c @@ -293,6 +293,7 @@ clar_run_suite(const struct clar_suite *suite, const char *filter) const struct clar_func *test = suite->tests; size_t i, matchlen; struct clar_report *report; + int exact = 0; if (!suite->enabled) return; @@ -317,6 +318,11 @@ clar_run_suite(const struct clar_suite *suite, const char *filter) while (*filter == ':') ++filter; matchlen = strlen(filter); + + if (matchlen && filter[matchlen - 1] == '$') { + exact = 1; + matchlen--; + } } } @@ -324,6 +330,9 @@ clar_run_suite(const struct clar_suite *suite, const char *filter) if (filter && strncmp(test[i].name, filter, matchlen)) continue; + if (exact && strlen(test[i].name) != matchlen) + continue; + _clar.active_test = test[i].name; report = calloc(1, sizeof(struct clar_report)); |