Approved tag alias tests

This commit is contained in:
Phil Nash 2014-06-30 07:34:27 +01:00
parent 1d210ebd37
commit 061861d940
4 changed files with 154 additions and 5 deletions

View File

@ -786,5 +786,5 @@ with expansion:
"first" == "second" "first" == "second"
=============================================================================== ===============================================================================
124 test cases - 39 failed (695 assertions - 92 failed) 125 test cases - 39 failed (703 assertions - 92 failed)

View File

@ -6884,6 +6884,72 @@ PASSED:
with expansion: with expansion:
true == true true == true
-------------------------------------------------------------------------------
Tag alias can be registered against tag patterns
The same tag alias can only be registered once
-------------------------------------------------------------------------------
TagAliasTests.cpp:<line number>
...............................................................................
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THAT( what Contains( "[@zzz]" ) )
with expansion:
"error: tag alias, "[@zzz]" already registered.
First seen at file:2
Redefined at file:10" contains: "
[@zzz]"
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THAT( what Contains( "file" ) )
with expansion:
"error: tag alias, "[@zzz]" already registered.
First seen at file:2
Redefined at file:10" contains:
"file"
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THAT( what Contains( "2" ) )
with expansion:
"error: tag alias, "[@zzz]" already registered.
First seen at file:2
Redefined at file:10" contains:
"2"
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THAT( what Contains( "10" ) )
with expansion:
"error: tag alias, "[@zzz]" already registered.
First seen at file:2
Redefined at file:10" contains:
"10"
-------------------------------------------------------------------------------
Tag alias can be registered against tag patterns
Tag aliases must be of the form [@name]
-------------------------------------------------------------------------------
TagAliasTests.cpp:<line number>
...............................................................................
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) )
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) )
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) )
TagAliasTests.cpp:<line number>:
PASSED:
CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) )
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Anonymous test case 1 Anonymous test case 1
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -7231,5 +7297,5 @@ with expansion:
true true
=============================================================================== ===============================================================================
124 test cases - 55 failed (715 assertions - 112 failed) 125 test cases - 55 failed (723 assertions - 112 failed)

View File

@ -1,5 +1,5 @@
<testsuites> <testsuites>
<testsuite errors="12" failures="100" tests="715" hostname="tbd" time="{duration}" timestamp="tbd"> <testsuite errors="12" failures="100" tests="723" hostname="tbd" time="{duration}" timestamp="tbd">
<testcase classname="global" name="Some simple comparisons between doubles" time="{duration}"/> <testcase classname="global" name="Some simple comparisons between doubles" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with different epsilons" time="{duration}"/> <testcase classname="global" name="Approximate comparisons with different epsilons" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with floats" time="{duration}"/> <testcase classname="global" name="Approximate comparisons with floats" time="{duration}"/>
@ -556,6 +556,8 @@ TrickyTests.cpp:<line number>
<testcase classname="Parse test names and tags" name="empty tag" time="{duration}"/> <testcase classname="Parse test names and tags" name="empty tag" time="{duration}"/>
<testcase classname="Parse test names and tags" name="empty quoted name" time="{duration}"/> <testcase classname="Parse test names and tags" name="empty quoted name" time="{duration}"/>
<testcase classname="Parse test names and tags" name="quoted string followed by tag exclusion" time="{duration}"/> <testcase classname="Parse test names and tags" name="quoted string followed by tag exclusion" time="{duration}"/>
<testcase classname="Tag alias can be registered against tag patterns" name="The same tag alias can only be registered once" time="{duration}"/>
<testcase classname="Tag alias can be registered against tag patterns" name="Tag aliases must be of the form [@name]" time="{duration}"/>
<testcase classname="global" name="Anonymous test case 1" time="{duration}"/> <testcase classname="global" name="Anonymous test case 1" time="{duration}"/>
<testcase classname="global" name="Test case with one argument" time="{duration}"/> <testcase classname="global" name="Test case with one argument" time="{duration}"/>
<testcase classname="Variadic macros" name="Section with one argument" time="{duration}"/> <testcase classname="Variadic macros" name="Section with one argument" time="{duration}"/>

View File

@ -7162,6 +7162,87 @@ there&quot;
</Section> </Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<TestCase name="Tag alias can be registered against tag patterns">
<Section name="The same tag alias can only be registered once">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
what Contains( &quot;[@zzz]&quot; )
</Original>
<Expanded>
&quot;error: tag alias, &quot;[@zzz]&quot; already registered.
First seen at file:2
Redefined at file:10&quot; contains: &quot;[@zzz]&quot;
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
what Contains( &quot;file&quot; )
</Original>
<Expanded>
&quot;error: tag alias, &quot;[@zzz]&quot; already registered.
First seen at file:2
Redefined at file:10&quot; contains: &quot;file&quot;
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
what Contains( &quot;2&quot; )
</Original>
<Expanded>
&quot;error: tag alias, &quot;[@zzz]&quot; already registered.
First seen at file:2
Redefined at file:10&quot; contains: &quot;2&quot;
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
what Contains( &quot;10&quot; )
</Original>
<Expanded>
&quot;error: tag alias, &quot;[@zzz]&quot; already registered.
First seen at file:2
Redefined at file:10&quot; contains: &quot;10&quot;
</Expanded>
</Expression>
<OverallResults successes="4" failures="0"/>
</Section>
<Section name="Tag aliases must be of the form [@name]">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
registry.add( &quot;[no ampersat]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Original>
<Expanded>
registry.add( &quot;[no ampersat]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
registry.add( &quot;[the @ is not at the start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Original>
<Expanded>
registry.add( &quot;[the @ is not at the start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
registry.add( &quot;@no square bracket at start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Original>
<Expanded>
registry.add( &quot;@no square bracket at start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Expanded>
</Expression>
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TagAliasTests.cpp" >
<Original>
registry.add( &quot;[@no square bracket at end&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Original>
<Expanded>
registry.add( &quot;[@no square bracket at end&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
</Expanded>
</Expression>
<OverallResults successes="4" failures="0"/>
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Anonymous test case 1"> <TestCase name="Anonymous test case 1">
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
@ -7483,7 +7564,7 @@ there&quot;
</Section> </Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<OverallResults successes="603" failures="112"/> <OverallResults successes="611" failures="112"/>
</Group> </Group>
<OverallResults successes="603" failures="112"/> <OverallResults successes="611" failures="112"/>
</Catch> </Catch>