runner.tests.cpp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <felspar/test.hpp>


namespace {


    auto const format = felspar::testsuite("format")

                                .test("no extra",
                                      [](auto check) {
                                          check(felspar::test::format_failure_message("filename.cpp", 10, 4, "test")) ==
        "Failed at filename.cpp:10:4";
                                      })

                                .test("unary check",
                                      [](auto check) {
                                          check(felspar::test::format_failure_message("filename.cpp", 10, 4, "test", "value1")) ==
        "Failed at filename.cpp:10:4\ncheck(value1) test";
                                      })

                                .test("binary check", [](auto check) {
                                    check(felspar::test::format_failure_message("filename.cpp", 10, 4, "test", "value1", "value2" )) ==
        "Failed at filename.cpp:10:4\ncheck(value1) test value2";
                                });


}