FIT_TEST_CASE() { auto f = fit::pipable(fit::limit_c<2>(binary_class())); static_assert(fit::is_callable<decltype(f), int, int>::value, "Passing the limit is not callable"); static_assert(!fit::is_callable<decltype(f), int, int, int>::value, "Passing the limit is not callable"); static_assert(!fit::is_callable<decltype(f), int, int, int, int>::value, "Passing the limit is not callable"); }
FIT_TEST_CASE() { FIT_STATIC_TEST_CHECK(fit::apply_eval(binary_class(), fit::always(1), fit::always(2)) == 3); FIT_TEST_CHECK(fit::apply_eval(binary_class(), []{ return 1; }, []{ return 2;}) == 3); }
FIT_TEST_CASE() { FIT_STATIC_TEST_CHECK(fit::capture(1, 2)(binary_class())() == 3); FIT_TEST_CHECK(fit::capture(1, 2)(binary_class())() == 3); FIT_STATIC_TEST_CHECK(fit::capture(1)(binary_class())(2) == 3); FIT_TEST_CHECK(fit::capture(1)(binary_class())(2) == 3); static const int one = 1; static const int two = 2; FIT_STATIC_TEST_CHECK(fit::capture_forward(one, two)(binary_class())() == 3); FIT_TEST_CHECK(fit::capture_forward(one, two)(binary_class())() == 3); FIT_TEST_CHECK(fit::capture_forward(1, 2)(binary_class())() == 3); FIT_STATIC_TEST_CHECK(fit::capture_forward(one)(binary_class())(two) == 3); FIT_TEST_CHECK(fit::capture_forward(1)(binary_class())(2) == 3); FIT_STATIC_TEST_CHECK(fit::capture_decay(1, 2)(binary_class())() == 3); FIT_TEST_CHECK(fit::capture_decay(1, 2)(binary_class())() == 3); FIT_STATIC_TEST_CHECK(fit::capture_decay(1)(binary_class())(2) == 3); FIT_TEST_CHECK(fit::capture_decay(1)(binary_class())(2) == 3); }
FIT_TEST_CASE() { FIT_STATIC_TEST_CHECK(fit::apply(binary_class(), 1, 2) == 3); FIT_TEST_CHECK(fit::apply(binary_class(), 1, 2) == 3); }