finished with examples!
diff --git a/examples/all_features/CMakeLists.txt b/examples/all_features/CMakeLists.txt
index a86ef09..8af72c8 100644
--- a/examples/all_features/CMakeLists.txt
+++ b/examples/all_features/CMakeLists.txt
@@ -61,6 +61,7 @@
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(disabled PRIVATE /wd4505) # unreferenced local function has been removed
target_compile_options(disabled PRIVATE /wd4100) # unreferenced formal parameter
+ target_compile_options(disabled PRIVATE /wd4189) # local variable is initialized but not referenced
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(disabled PRIVATE -Wno-unknown-warning-option)
target_compile_options(disabled PRIVATE -Wno-unneeded-internal-declaration)
@@ -70,4 +71,5 @@
target_compile_options(disabled PRIVATE -Wno-unused-local-typedefs)
target_compile_options(disabled PRIVATE -Wno-unused-parameter)
target_compile_options(disabled PRIVATE -Wno-unused-function)
+ target_compile_options(disabled PRIVATE -Wno-unused-variable)
endif()
diff --git a/examples/all_features/assertion_macros.cpp b/examples/all_features/assertion_macros.cpp
index fb12504..f2869eb 100644
--- a/examples/all_features/assertion_macros.cpp
+++ b/examples/all_features/assertion_macros.cpp
@@ -20,17 +20,23 @@
CHECK(doctest::Approx(0.1000001) == 0.1000002);
CHECK(doctest::Approx(0.502) == 0.501);
+}
- throw_if(true, 0);
+TEST_CASE("expressions should be evaluated only once") {
+ int a = 5;
+ REQUIRE(++a == 6);
+ REQUIRE_EQ(++a, 7);
}
TEST_CASE("exceptions-related macros") {
- CHECK_THROWS(throw_if(false, 0));
- CHECK_THROWS_AS(throw_if(false, 0), int);
+ CHECK_THROWS(throw_if(true, 0));
+ CHECK_THROWS(throw_if(false, 0)); // fails
CHECK_THROWS_AS(throw_if(true, 0), int);
- CHECK_THROWS_AS(throw_if(true, 0), char);
+ CHECK_THROWS_AS(throw_if(true, 0), char); // fails
+ CHECK_THROWS_AS(throw_if(false, 0), int); // fails
- CHECK_NOTHROW(throw_if(true, 0));
+ CHECK_NOTHROW(throw_if(true, 0)); // fails
+ CHECK_NOTHROW(throw_if(false, 0));
}
TEST_CASE("exceptions-related macros for std::exception") {
@@ -41,3 +47,164 @@
REQUIRE_NOTHROW(throw_if(true, std::runtime_error("whops!")));
}
+
+// =================================================================================================
+// == TESTING (ALMOST) ALL ASSERTS THAT THEY ACT ACCORDINGLY - not interesting examples...
+// =================================================================================================
+
+TEST_CASE("WARN level of asserts don't fail the test case") {
+ WARN(0);
+ WARN_FALSE(1);
+ WARN_THROWS(throw_if(false, 0));
+ WARN_THROWS_AS(throw_if(false, 0), bool);
+ WARN_THROWS_AS(throw_if(true, 0), bool);
+ WARN_NOTHROW(throw_if(true, 0));
+
+ WARN_EQ(1, 0);
+ WARN_UNARY(0);
+ WARN_UNARY_FALSE(1);
+
+ FAST_WARN_EQ(1, 0);
+ FAST_WARN_UNARY(0);
+ FAST_WARN_UNARY_FALSE(1);
+}
+
+TEST_CASE("CHECK level of asserts fail the test case but don't abort it") {
+ CHECK(0);
+ CHECK_FALSE(1);
+ CHECK_THROWS(throw_if(false, 0));
+ CHECK_THROWS_AS(throw_if(false, 0), bool);
+ CHECK_THROWS_AS(throw_if(true, 0), bool);
+ CHECK_NOTHROW(throw_if(true, 0));
+
+ CHECK_EQ(1, 0);
+ CHECK_UNARY(0);
+ CHECK_UNARY_FALSE(1);
+
+ FAST_CHECK_EQ(1, 0);
+ FAST_CHECK_UNARY(0);
+ FAST_CHECK_UNARY_FALSE(1);
+
+ MESSAGE("reached!");
+}
+
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 1") {
+ REQUIRE(0);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 2") {
+ REQUIRE_FALSE(1);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 3") {
+ REQUIRE_THROWS(throw_if(false, 0));
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 4") {
+ REQUIRE_THROWS_AS(throw_if(false, 0), bool);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 5") {
+ REQUIRE_THROWS_AS(throw_if(true, 0), bool);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 6") {
+ REQUIRE_NOTHROW(throw_if(true, 0));
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 7") {
+ REQUIRE_EQ(1, 0);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 8") {
+ REQUIRE_UNARY(0);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 9") {
+ REQUIRE_UNARY_FALSE(1);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 10") {
+ FAST_REQUIRE_EQ(1, 0);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 11") {
+ FAST_REQUIRE_UNARY(0);
+ MESSAGE("should not be reached!");
+}
+TEST_CASE("REQUIRE level of asserts fail and abort the test case - 12") {
+ FAST_REQUIRE_UNARY_FALSE(1);
+ MESSAGE("should not be reached!");
+}
+
+TEST_CASE("all binary assertions") {
+ WARN_EQ(1, 1);
+ CHECK_EQ(1, 1);
+ REQUIRE_EQ(1, 1);
+ WARN_NE(1, 0);
+ CHECK_NE(1, 0);
+ REQUIRE_NE(1, 0);
+ WARN_GT(1, 0);
+ CHECK_GT(1, 0);
+ REQUIRE_GT(1, 0);
+ WARN_LT(0, 1);
+ CHECK_LT(0, 1);
+ REQUIRE_LT(0, 1);
+ WARN_GE(1, 1);
+ CHECK_GE(1, 1);
+ REQUIRE_GE(1, 1);
+ WARN_LE(1, 1);
+ CHECK_LE(1, 1);
+ REQUIRE_LE(1, 1);
+ WARN_UNARY(1);
+ CHECK_UNARY(1);
+ REQUIRE_UNARY(1);
+ WARN_UNARY_FALSE(0);
+ CHECK_UNARY_FALSE(0);
+ REQUIRE_UNARY_FALSE(0);
+ FAST_WARN_EQ(1, 1);
+ FAST_CHECK_EQ(1, 1);
+ FAST_REQUIRE_EQ(1, 1);
+ FAST_WARN_NE(1, 0);
+ FAST_CHECK_NE(1, 0);
+ FAST_REQUIRE_NE(1, 0);
+ FAST_WARN_GT(1, 0);
+ FAST_CHECK_GT(1, 0);
+ FAST_REQUIRE_GT(1, 0);
+ FAST_WARN_LT(0, 1);
+ FAST_CHECK_LT(0, 1);
+ FAST_REQUIRE_LT(0, 1);
+ FAST_WARN_GE(1, 1);
+ FAST_CHECK_GE(1, 1);
+ FAST_REQUIRE_GE(1, 1);
+ FAST_WARN_LE(1, 1);
+ FAST_CHECK_LE(1, 1);
+ FAST_REQUIRE_LE(1, 1);
+ FAST_WARN_UNARY(1);
+ FAST_CHECK_UNARY(1);
+ FAST_REQUIRE_UNARY(1);
+ FAST_WARN_UNARY_FALSE(0);
+ FAST_CHECK_UNARY_FALSE(0);
+ FAST_REQUIRE_UNARY_FALSE(0);
+}
+
+static void someAssertsInFunction() {
+ int a = 5;
+ int b = 5;
+ CHECK(a == b);
+ CHECK_FALSE(a != b);
+ CHECK_THROWS(throw_if(true, 0));
+ CHECK_THROWS_AS(throw_if(true, 0), int);
+ CHECK_NOTHROW(throw_if(false, 0));
+
+ CHECK_EQ(a, b);
+ CHECK_UNARY(a == b);
+ CHECK_UNARY_FALSE(a != b);
+ FAST_CHECK_EQ(a, b);
+ FAST_CHECK_UNARY(a == b);
+ FAST_CHECK_UNARY_FALSE(a != b);
+}
+
+TEST_CASE("some asserts used in a function called by a test case") {
+ someAssertsInFunction();
+}
diff --git a/examples/all_features/coverage_maxout.cpp b/examples/all_features/coverage_maxout.cpp
index 4e91f06..68016bc 100644
--- a/examples/all_features/coverage_maxout.cpp
+++ b/examples/all_features/coverage_maxout.cpp
@@ -45,119 +45,4 @@
CHECK(doctest::detail::rawMemoryToString(a).length() > 0u);
}
-TEST_SUITE_BEGIN("ts1");
-
-using doctest::Approx;
-
-struct myType
-{
- myType() {}
-
-private:
- myType(const myType&); // non-copyable
- myType& operator=(const myType&); // non-assignable
-};
-
-static std::ostream& operator<<(std::ostream& stream, const myType&) {
- stream << "myType!";
- return stream;
-}
-
-static bool operator==(const myType&, const myType&) { return false; }
-
-TEST_CASE("expressions should be evaluated only once") {
- int a = 5;
- REQUIRE(++a == 6);
- REQUIRE_EQ(++a, 7);
-}
-
-TEST_CASE("assertions") {
- CHECK(true);
- CHECK(1 == 0);
- CHECK_FALSE(1);
- myType a;
- myType b;
- CHECK(a == b);
- CHECK(Approx(0.1) == 0.2);
-
- CHECK_THROWS(throws(true));
- CHECK_THROWS(throws(false));
- CHECK_NOTHROW(throws(false));
- CHECK_NOTHROW(throws(true));
- CHECK_THROWS_AS(throws(true), bool);
- REQUIRE_THROWS_AS(throws(false), bool);
-}
-
-TEST_CASE("assertions - all of them") {
- WARN(true);
- CHECK(true);
- REQUIRE(true);
- WARN_FALSE(false);
- CHECK_FALSE(false);
- REQUIRE_FALSE(false);
- WARN_THROWS(throws(true));
- CHECK_THROWS(throws(true));
- REQUIRE_THROWS(throws(true));
- WARN_THROWS_AS(throws(true), bool);
- CHECK_THROWS_AS(throws(true), bool);
- REQUIRE_THROWS_AS(throws(true), bool);
- WARN_NOTHROW(throws(false));
- CHECK_NOTHROW(throws(false));
- REQUIRE_NOTHROW(throws(false));
- WARN_EQ(1, 1);
- CHECK_EQ(1, 1);
- REQUIRE_EQ(1, 1);
- WARN_NE(1, 0);
- CHECK_NE(1, 0);
- REQUIRE_NE(1, 0);
- WARN_GT(1, 0);
- CHECK_GT(1, 0);
- REQUIRE_GT(1, 0);
- WARN_LT(0, 1);
- CHECK_LT(0, 1);
- REQUIRE_LT(0, 1);
- WARN_GE(1, 1);
- CHECK_GE(1, 1);
- REQUIRE_GE(1, 1);
- WARN_LE(1, 1);
- CHECK_LE(1, 1);
- REQUIRE_LE(1, 1);
- WARN_UNARY(1);
- CHECK_UNARY(1);
- REQUIRE_UNARY(1);
- WARN_UNARY_FALSE(0);
- CHECK_UNARY_FALSE(0);
- REQUIRE_UNARY_FALSE(0);
- FAST_WARN_EQ(1, 1);
- FAST_CHECK_EQ(1, 1);
- FAST_REQUIRE_EQ(1, 1);
- FAST_WARN_NE(1, 0);
- FAST_CHECK_NE(1, 0);
- FAST_REQUIRE_NE(1, 0);
- FAST_WARN_GT(1, 0);
- FAST_CHECK_GT(1, 0);
- FAST_REQUIRE_GT(1, 0);
- FAST_WARN_LT(0, 1);
- FAST_CHECK_LT(0, 1);
- FAST_REQUIRE_LT(0, 1);
- FAST_WARN_GE(1, 1);
- FAST_CHECK_GE(1, 1);
- FAST_REQUIRE_GE(1, 1);
- FAST_WARN_LE(1, 1);
- FAST_CHECK_LE(1, 1);
- FAST_REQUIRE_LE(1, 1);
- FAST_WARN_UNARY(1);
- FAST_CHECK_UNARY(1);
- FAST_REQUIRE_UNARY(1);
- FAST_WARN_UNARY_FALSE(0);
- FAST_CHECK_UNARY_FALSE(0);
- FAST_REQUIRE_UNARY_FALSE(1);
-}
-
-TEST_CASE("throws") { throws(true); }
-
-TEST_SUITE_END();
-
-#endif // DOCTEST_CONFIG_DISABLE
-
*/
diff --git a/examples/all_features/test_cases_and_suites.cpp b/examples/all_features/test_cases_and_suites.cpp
index be5c5a1..a5c30c8 100644
--- a/examples/all_features/test_cases_and_suites.cpp
+++ b/examples/all_features/test_cases_and_suites.cpp
@@ -2,9 +2,18 @@
#include "header.h"
+static void doStuff() {
+ int a = 5;
+ a += 2;
+ if(doctest::isRunningInTest())
+ CHECK(a == 7); // asserts and other doctest functionality can be used in user code if checked for a testing context
+}
+
TEST_CASE("an empty test that will succeed - not part of a test suite") {}
-TEST_CASE("an empty test that will fail because of an exception") {
+TEST_CASE("should fail because of an exception") {
+ doStuff();
+
throw_if(true, 0);
}
diff --git a/examples/all_features/test_output/assertion_macros.cpp.txt b/examples/all_features/test_output/assertion_macros.cpp.txt
index 890941c..e1e2d76 100644
--- a/examples/all_features/test_output/assertion_macros.cpp.txt
+++ b/examples/all_features/test_output/assertion_macros.cpp.txt
@@ -13,10 +13,6 @@
with expansion:
CHECK( Approx( 0.502 ) == 0.501 )
-TEST CASE FAILED!
-threw exception:
- 0
-
== TEST CASE ==================================================================
assertion_macros.cpp(0)
exceptions-related macros
@@ -26,15 +22,15 @@
didn't throw at all
assertion_macros.cpp(0) ERROR!
- CHECK_THROWS_AS( throw_if(false, 0), int )
-didn't throw at all
-
-assertion_macros.cpp(0) ERROR!
CHECK_THROWS_AS( throw_if(true, 0), char )
threw a different exception:
0
assertion_macros.cpp(0) ERROR!
+ CHECK_THROWS_AS( throw_if(false, 0), int )
+didn't throw at all
+
+assertion_macros.cpp(0) ERROR!
CHECK_NOTHROW( throw_if(true, 0) )
threw exception:
0
@@ -61,7 +57,240 @@
threw exception:
whops!
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+WARN level of asserts don't fail the test case
+
+assertion_macros.cpp(0) WARNING!
+ WARN( 0 )
+with expansion:
+ WARN( 0 )
+
+assertion_macros.cpp(0) WARNING!
+ WARN_FALSE( 1 )
+with expansion:
+ WARN_FALSE( 1 )
+
+assertion_macros.cpp(0) WARNING!
+ WARN_THROWS( throw_if(false, 0) )
+didn't throw at all
+
+assertion_macros.cpp(0) WARNING!
+ WARN_THROWS_AS( throw_if(false, 0), bool )
+didn't throw at all
+
+assertion_macros.cpp(0) WARNING!
+ WARN_THROWS_AS( throw_if(true, 0), bool )
+threw a different exception:
+ 0
+
+assertion_macros.cpp(0) WARNING!
+ WARN_NOTHROW( throw_if(true, 0) )
+threw exception:
+ 0
+
+assertion_macros.cpp(0) WARNING!
+ WARN_EQ( 1, 0 )
+with expansion:
+ WARN_EQ( 1, 0 )
+
+assertion_macros.cpp(0) WARNING!
+ WARN_UNARY( 0 )
+with expansion:
+ WARN_UNARY( 0 )
+
+assertion_macros.cpp(0) WARNING!
+ WARN_UNARY_FALSE( 1 )
+with expansion:
+ WARN_UNARY_FALSE( 1 )
+
+assertion_macros.cpp(0) WARNING!
+ FAST_WARN_EQ( 1, 0 )
+with expansion:
+ FAST_WARN_EQ( 1, 0 )
+
+assertion_macros.cpp(0) WARNING!
+ FAST_WARN_UNARY( 0 )
+with expansion:
+ FAST_WARN_UNARY( 0 )
+
+assertion_macros.cpp(0) WARNING!
+ FAST_WARN_UNARY_FALSE( 1 )
+with expansion:
+ FAST_WARN_UNARY_FALSE( 1 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+CHECK level of asserts fail the test case but don't abort it
+
+assertion_macros.cpp(0) ERROR!
+ CHECK( 0 )
+with expansion:
+ CHECK( 0 )
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_FALSE( 1 )
+with expansion:
+ CHECK_FALSE( 1 )
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_THROWS( throw_if(false, 0) )
+didn't throw at all
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_THROWS_AS( throw_if(false, 0), bool )
+didn't throw at all
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_THROWS_AS( throw_if(true, 0), bool )
+threw a different exception:
+ 0
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_NOTHROW( throw_if(true, 0) )
+threw exception:
+ 0
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_EQ( 1, 0 )
+with expansion:
+ CHECK_EQ( 1, 0 )
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_UNARY( 0 )
+with expansion:
+ CHECK_UNARY( 0 )
+
+assertion_macros.cpp(0) ERROR!
+ CHECK_UNARY_FALSE( 1 )
+with expansion:
+ CHECK_UNARY_FALSE( 1 )
+
+assertion_macros.cpp(0) ERROR!
+ FAST_CHECK_EQ( 1, 0 )
+with expansion:
+ FAST_CHECK_EQ( 1, 0 )
+
+assertion_macros.cpp(0) ERROR!
+ FAST_CHECK_UNARY( 0 )
+with expansion:
+ FAST_CHECK_UNARY( 0 )
+
+assertion_macros.cpp(0) ERROR!
+ FAST_CHECK_UNARY_FALSE( 1 )
+with expansion:
+ FAST_CHECK_UNARY_FALSE( 1 )
+
+assertion_macros.cpp(0) MESSAGE!
+ reached!
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 1
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE( 0 )
+with expansion:
+ REQUIRE( 0 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 2
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_FALSE( 1 )
+with expansion:
+ REQUIRE_FALSE( 1 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 3
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_THROWS( throw_if(false, 0) )
+didn't throw at all
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 4
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_THROWS_AS( throw_if(false, 0), bool )
+didn't throw at all
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 5
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_THROWS_AS( throw_if(true, 0), bool )
+threw a different exception:
+ 0
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 6
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_NOTHROW( throw_if(true, 0) )
+threw exception:
+ 0
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 7
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_EQ( 1, 0 )
+with expansion:
+ REQUIRE_EQ( 1, 0 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 8
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_UNARY( 0 )
+with expansion:
+ REQUIRE_UNARY( 0 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 9
+
+assertion_macros.cpp(0) FATAL ERROR!
+ REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ REQUIRE_UNARY_FALSE( 1 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 10
+
+assertion_macros.cpp(0) FATAL ERROR!
+ FAST_REQUIRE_EQ( 1, 0 )
+with expansion:
+ FAST_REQUIRE_EQ( 1, 0 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 11
+
+assertion_macros.cpp(0) FATAL ERROR!
+ FAST_REQUIRE_UNARY( 0 )
+with expansion:
+ FAST_REQUIRE_UNARY( 0 )
+
+== TEST CASE ==================================================================
+assertion_macros.cpp(0)
+REQUIRE level of asserts fail and abort the test case - 12
+
+assertion_macros.cpp(0) FATAL ERROR!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+
===============================================================================
-[doctest] test cases: 3 | 0 passed | 3 failed |
-[doctest] assertions: 17 | 7 passed | 10 failed |
+[doctest] test cases: 20 | 4 passed | 16 failed |
+[doctest] assertions: 88 | 54 passed | 34 failed |
Program code.
diff --git a/examples/all_features/test_output/test_cases_and_suites.cpp.txt b/examples/all_features/test_output/test_cases_and_suites.cpp.txt
index 07e1041..b085079 100644
--- a/examples/all_features/test_output/test_cases_and_suites.cpp.txt
+++ b/examples/all_features/test_output/test_cases_and_suites.cpp.txt
@@ -1,7 +1,7 @@
[doctest] run with "--help" for options
== TEST CASE ==================================================================
test_cases_and_suites.cpp(0)
-an empty test that will fail because of an exception
+should fail because of an exception
TEST CASE FAILED!
threw exception:
@@ -36,5 +36,5 @@
===============================================================================
[doctest] test cases: 6 | 1 passed | 5 failed |
-[doctest] assertions: 1 | 0 passed | 1 failed |
+[doctest] assertions: 2 | 1 passed | 1 failed |
Program code.