From 061861d940ebc957c493cde99ccb2d15554ef8f9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 30 Jun 2014 07:34:27 +0100 Subject: [PATCH] Approved tag alias tests --- .../Baselines/console.std.approved.txt | 2 +- .../Baselines/console.sw.approved.txt | 68 ++++++++++++++- .../SelfTest/Baselines/junit.sw.approved.txt | 4 +- .../SelfTest/Baselines/xml.sw.approved.txt | 85 ++++++++++++++++++- 4 files changed, 154 insertions(+), 5 deletions(-) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 3b33a28a..113b7fc5 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -786,5 +786,5 @@ with expansion: "first" == "second" =============================================================================== -124 test cases - 39 failed (695 assertions - 92 failed) +125 test cases - 39 failed (703 assertions - 92 failed) diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index c6a11ee0..9732c99d 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -6884,6 +6884,72 @@ PASSED: with expansion: true == true +------------------------------------------------------------------------------- +Tag alias can be registered against tag patterns + The same tag alias can only be registered once +------------------------------------------------------------------------------- +TagAliasTests.cpp: +............................................................................... + +TagAliasTests.cpp:: +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:: +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:: +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:: +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: +............................................................................... + +TagAliasTests.cpp:: +PASSED: + CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +TagAliasTests.cpp:: +PASSED: + CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +TagAliasTests.cpp:: +PASSED: + CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +TagAliasTests.cpp:: +PASSED: + CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ) + ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- @@ -7231,5 +7297,5 @@ with expansion: true =============================================================================== -124 test cases - 55 failed (715 assertions - 112 failed) +125 test cases - 55 failed (723 assertions - 112 failed) diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index fe7e7645..35ad75f5 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ - + @@ -556,6 +556,8 @@ TrickyTests.cpp: + + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 5e4e2c4b..4b1e9269 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -7162,6 +7162,87 @@ there" + +
+ + + what Contains( "[@zzz]" ) + + + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "[@zzz]" + + + + + what Contains( "file" ) + + + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "file" + + + + + what Contains( "2" ) + + + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "2" + + + + + what Contains( "10" ) + + + "error: tag alias, "[@zzz]" already registered. + First seen at file:2 + Redefined at file:10" contains: "10" + + + +
+
+ + + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + + + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + + + + + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + + + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + + + + + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + + + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + + + + + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + + + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + + + +
+ +
@@ -7483,7 +7564,7 @@ there"
- + - +