File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ clar_run_suite(const struct clar_suite *suite, const char *filter)
293293 const struct clar_func * test = suite -> tests ;
294294 size_t i , matchlen ;
295295 struct clar_report * report ;
296+ int exact = 0 ;
296297
297298 if (!suite -> enabled )
298299 return ;
@@ -317,13 +318,21 @@ clar_run_suite(const struct clar_suite *suite, const char *filter)
317318 while (* filter == ':' )
318319 ++ filter ;
319320 matchlen = strlen (filter );
321+
322+ if (matchlen && filter [matchlen - 1 ] == '$' ) {
323+ exact = 1 ;
324+ matchlen -- ;
325+ }
320326 }
321327 }
322328
323329 for (i = 0 ; i < suite -> test_count ; ++ i ) {
324330 if (filter && strncmp (test [i ].name , filter , matchlen ))
325331 continue ;
326332
333+ if (exact && strlen (test [i ].name ) != matchlen )
334+ continue ;
335+
327336 _clar .active_test = test [i ].name ;
328337
329338 report = calloc (1 , sizeof (struct clar_report ));
You can’t perform that action at this time.
0 commit comments