Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Added nested sections test

Commit
b3ef7fc0f28c289613b7a16298bbf13ff45499f5
Author
Phil Nash ·
Parents
aae41833b0fc

Files · Download .tar.gz

Changes

 Test/MiscTests.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Test/MiscTests.cpp b/Test/MiscTests.cpp
index 0aee8c32..d87dd5d4 100644
--- a/Test/MiscTests.cpp
+++ b/Test/MiscTests.cpp
@@ -29,6 +29,23 @@ TEST_CASE( "succeeding/Misc/Sections", "random SECTION tests" )
     }
 }
 
+TEST_CASE( "succeeding/Misc/Sections/nested", "nested SECTION tests" )
+{
+    int a = 1;
+    int b = 2;
+    
+    SECTION( "s1", "doesn't equal" )
+    {
+        REQUIRE( a != b );
+        REQUIRE( b != a );
+
+        SECTION( "s2", "not equal" )
+        {
+            REQUIRE_FALSE( a == b);
+        }
+    }
+}
+
 TEST_CASE( "succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" )
 {
     std::cout << "Some information";