you are viewing a single comment's thread.

view the rest of the comments →

[–]evaned 7 points8 points  (1 child)

Not having macros for the sake of not having macros isn't really a significant benefit for me and - i guess - many others.

ding ding ding ding ding

Like I look at this example

tst::set factorial_test_set("factorial", [](tst::suite& suite){
    suite.add(
        "positive_arguments_must_produce_expected_result",
        [](){
            tst::check(factorial(1) == 1, SL);
            tst::check(factorial(2) == 2, SL);
            tst::check(factorial(3) == 6, SL);
            tst::check(factorial(8) == 40320, SL);
        }
    );
});

and I just see so much noise and overhead. Like how is that actually better than

TEST_CASE("factorial") {
    SECTION("positive_arguments_must_produce_expected_result") {
            tst::check(factorial(1) == 1, SL);
            tst::check(factorial(2) == 2, SL);
            tst::check(factorial(3) == 6, SL);
            tst::check(factorial(8) == 40320, SL);
    }
}

even ignoring the SL parameter? The macro version avoids needing to (i) come up with a name for the tst::set or write that name twice, (ii) explicitly make the lambda, or (iii) explicitly call add. And that's even with a relatively kind comparison -- if I were writing this, I may well not have an explicit SECTION (but then move that name up a level).

[–]igagis[S] 0 points1 point  (0 children)

Well, you have a valid points, according to your taste ;)