diff --git a/lest.hpp b/lest.hpp index c098410..2275ed1 100644 --- a/lest.hpp +++ b/lest.hpp @@ -815,9 +815,9 @@ inline bool select( text name, texts include ) auto none = []( texts args ) { return args.size() == 0; }; #if lest_FEATURE_REGEX_SEARCH - auto hidden = []( text name ){ return match( { "\\[\\.\\]", "\\[hide\\]" }, name ); }; + auto hidden = []( text name ){ return match( { "\\[\\..*", "\\[hide\\]" }, name ); }; #else - auto hidden = []( text name ){ return match( { "[.]", "[hide]" }, name ); }; + auto hidden = []( text name ){ return match( { "[.", "[hide]" }, name ); }; #endif if ( none( include ) ) diff --git a/lest_cpp03.hpp b/lest_cpp03.hpp index 697e4ef..3b6ae26 100644 --- a/lest_cpp03.hpp +++ b/lest_cpp03.hpp @@ -677,7 +677,7 @@ inline bool hidden( text name ) #if lest_FEATURE_REGEX_SEARCH texts skipped; skipped.push_back( "\\[\\.\\]" ); skipped.push_back( "\\[hide\\]" ); #else - texts skipped; skipped.push_back( "[.]" ); skipped.push_back( "[hide]" ); + texts skipped; skipped.push_back( "[." ); skipped.push_back( "[hide]" ); #endif return match( skipped, name ); } diff --git a/test/test_lest.cpp b/test/test_lest.cpp index 69dea18..f87a54a 100644 --- a/test/test_lest.cpp +++ b/test/test_lest.cpp @@ -517,12 +517,17 @@ const lest::test specification[] = EXPECT( divide( 22, 7 ) != approx( 3.141 ).epsilon( 0.0001 ) ); }, + CASE( "Skips tests tagged [hide]" ) + { + EXPECT( false ); + }, + CASE( "Skips tests tagged [.]" ) { EXPECT( false ); }, - CASE( "Skips tests tagged [hide]" ) + CASE( "Skips tests with tags that start with [.followed by anything]" ) { EXPECT( false ); }, diff --git a/test/test_lest_cpp03.cpp b/test/test_lest_cpp03.cpp index 8cb8066..b4ccd40 100644 --- a/test/test_lest_cpp03.cpp +++ b/test/test_lest_cpp03.cpp @@ -549,12 +549,17 @@ CASE( "Approximate to Pi compares properly [approx][pi]" ) EXPECT( f::divide( 22, 7 ) != approx( 3.141 ).epsilon( 0.0001 ) ); } +CASE( "Skips tests tagged [hide]" ) +{ + EXPECT( false ); +} + CASE( "Skips tests tagged [.]" ) { EXPECT( false ); } -CASE( "Skips tests tagged [hide]" ) +CASE( "Skips tests with tags that start with [.followed by anything]" ) { EXPECT( false ); }