78 TEST_CASE(
"TEST_CASE: Name and tags",
"[hide][tutorial]" ) {
84 TEST_CASE(
"TEST_CASE: Name, description and tags",
"Description. [hide][tutorial]" ) {
99 TEST_CASE(
"ASSERTIONS: Natural expressions",
"[hide][tutorial]" ) {
103 int a = 1, b = a, c = 2;
114 TEST_CASE(
"ASSERTIONS: Exceptions",
"[hide][tutorial]" ) {
129 TEST_CASE(
"ASSERTIONS: Matcher expressions: Equals",
"[hide][tutorial]" ) {
134 TEST_CASE(
"ASSERTIONS: Matcher expressions: Contains",
"[hide][tutorial]" ) {
139 TEST_CASE(
"ASSERTIONS: Matcher expressions: StartsWith",
"[hide][tutorial]" ) {
144 TEST_CASE(
"ASSERTIONS: Matcher expressions: EndsWith",
"[hide][tutorial]" ) {
154 TEST_CASE (
"Float vs double precision",
"[hide][tutorial]") {
160 float f_number = 0.1;
161 double d_number = 0.1;
174 std::string info =
" logged.";
175 INFO(
"The info is " << info);
179 std::string warning =
" not important at all.";
180 WARN(
"The warning is " << warning);
185 std::string failure =
" not a failure at all, it is supposed to fail.";
186 FAIL(
"The failure is " << failure);
189 TEST_CASE(
"LOGGING: SCOPED_INFO",
"[hide][tutorial]" ) {
190 std::string scoped_info =
" will only be logged if a test fails in the current scope.";
206 SCENARIO(
"BDD scenario",
"Behavior-driven development scenario. [hide][tutorial][BDD]"){
207 GIVEN(
"we create a new std::vector"){
208 std::vector<int> vector;
210 WHEN(
"we add a int to the vector"){
212 THEN(
"we can require that the vectors lenght is 1"){
215 AND_WHEN(
"we add another int to the vector"){
217 THEN(
"we can require that the vectors lenght is 2"){
221 THEN(
"we can require that the vectors lenght is still 1"){
225 THEN(
"we can require that the vector is empty"){
#define CHECK_THROWS_AS(expr, exceptionType)
SCENARIO("BDD scenario","Behavior-driven development scenario. [hide][tutorial][BDD]")
#define REQUIRE_FALSE(expr)
#define CHECK_THAT(arg, matcher)
#define REQUIRE_THROWS_AS(expr, exceptionType)
#define CHECK_NOTHROW(expr)
Impl::StdString::Equals Equals(std::string const &str)
Impl::StdString::Contains Contains(std::string const &substr)
Impl::StdString::StartsWith StartsWith(std::string const &substr)
#define REQUIRE_THROWS(expr)
TEST_CASE("TEST_CASE: Name and tags","[hide][tutorial]")
#define REQUIRE_NOTHROW(expr)
#define REQUIRE_THAT(arg, matcher)
Approx & epsilon(double newEpsilon)
Impl::StdString::EndsWith EndsWith(std::string const &substr)
#define CHECK_THROWS(expr)
#define CHECK_FALSE(expr)