#include #include using namespace alsk::edsl; struct Generate { int operator()() { return 0; } }; struct Select { int operator()(int a, int b) { return std::max(a, b); } }; TEST_CASE("edsl::FarmSel") { auto generate = makeOperand(); auto select = makeOperand(); auto e0 = (10 * generate) ->* select; using E0 = decltype(e0); using S0 = alsk::S; using L0 = alsk::L; auto e1 = link(*generate) ->* select; using E1 = decltype(e1); using S1 = alsk::S; using L1 = alsk::L; auto e2 = farm(generate).select(select); using E2 = decltype(e2); using S2 = alsk::S; using L2 = alsk::L; SECTION("Construction") { REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); } SECTION("Setup") { auto f0 = implement(e0); REQUIRE(f0.skeleton.n == 10); auto f1 = implement(e1); REQUIRE(f1.skeleton.n == 0); auto f2 = implement(e2); REQUIRE(f2.skeleton.n == 0); } }