mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
tags with . prefix are all hidden
This commit is contained in:
parent
6725e09003
commit
0dd214f6db
@ -30,7 +30,7 @@ namespace Catch {
|
|||||||
return TestCaseInfo::None;
|
return TestCaseInfo::None;
|
||||||
}
|
}
|
||||||
inline bool isReservedTag( std::string const& tag ) {
|
inline bool isReservedTag( std::string const& tag ) {
|
||||||
return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] );
|
return TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] );
|
||||||
}
|
}
|
||||||
inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
|
inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
|
||||||
if( isReservedTag( tag ) ) {
|
if( isReservedTag( tag ) ) {
|
||||||
@ -70,14 +70,15 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( c == ']' ) {
|
if( c == ']' ) {
|
||||||
|
TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
|
||||||
|
if( prop == TestCaseInfo::IsHidden )
|
||||||
|
isHidden = true;
|
||||||
|
else if( prop == TestCaseInfo::None )
|
||||||
enforceNotReservedTag( tag, _lineInfo );
|
enforceNotReservedTag( tag, _lineInfo );
|
||||||
|
|
||||||
inTag = false;
|
|
||||||
if( tag == "hide" || tag == "." )
|
|
||||||
isHidden = true;
|
|
||||||
else
|
|
||||||
tags.insert( tag );
|
tags.insert( tag );
|
||||||
tag.clear();
|
tag.clear();
|
||||||
|
inTag = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tag += c;
|
tag += c;
|
||||||
|
@ -348,7 +348,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// !TBD: This will be folded into Text class
|
// !TBD: This will be folded into Text class
|
||||||
TEST_CASE( "Strings can be rendered with colour", "[colour][.]" ) {
|
TEST_CASE( "Strings can be rendered with colour", "[.colour]" ) {
|
||||||
|
|
||||||
{
|
{
|
||||||
ColourString cs( "hello" );
|
ColourString cs( "hello" );
|
||||||
|
Loading…
Reference in New Issue
Block a user