#include #include using namespace alsk::edsl; struct Do { void operator()() { std::puts("Do"); } }; TEST_CASE("edsl::Farm") { auto aDo = makeOperand(); auto e0 = *aDo; using E0 = decltype(e0); using S0 = alsk::S; using L0 = alsk::L; auto e1 = 5*aDo; using E1 = decltype(e1); using S1 = alsk::S; using L1 = alsk::L; auto e2 = aDo*3; using E2 = decltype(e2); using S2 = alsk::S; using L2 = alsk::L; auto e3 = farm(aDo, 3); using E3 = decltype(e3); using S3 = alsk::S; using L3 = 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{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); REQUIRE(std::is_same{}); } SECTION("Setup") { auto f0 = implement(e0); REQUIRE(f0.skeleton.n == 0); auto f1 = implement(e1); REQUIRE(f1.skeleton.n == 5); auto f2 = implement(e2); REQUIRE(f2.skeleton.n == 3); auto f3 = implement(e3); REQUIRE(f3.skeleton.n == 3); } }