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
28
29
30
31
32
#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"))
                                      == "filename.cpp:10:4: Error";
                          })

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

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


}