alsk/tests/edsl/op/serial.cpp

38 lines
1009 B
C++
Raw Normal View History

2021-05-10 16:14:13 +00:00
#include <catch.hpp>
#include <alsk/alsk.h>
using namespace alsk::edsl;
struct Do { void operator()() { std::puts("Do"); } };
struct Then { void operator()() { std::puts("Then"); } };
struct Done { void operator()() { std::puts("Done"); } };
TEST_CASE("edsl::Serial") {
auto aDo = makeOperand<Do>();
auto aThen = makeOperand<Then>();
auto aDone = makeOperand<Done>();
using E0 = decltype(aDo & aThen);
using E1 = decltype(aDo, aThen, aDone);
using S0 = alsk::S<alsk::Serial, Do, Then>;
using S1 = alsk::S<alsk::Serial, Do, Then, Done>;
using L0 = alsk::L<alsk::Serial, void(), void(), void()>;
using L1 = alsk::L<alsk::Serial, void(), void(), void(), void()>;
SECTION("Construction") {
REQUIRE(std::is_same<E0::Signature, void()>{});
REQUIRE(std::is_same<E1::Signature, void()>{});
REQUIRE(std::is_same<E0::Struct, S0>{});
REQUIRE(std::is_same<E1::Struct, S1>{});
REQUIRE(std::is_same<E0::Links, L0>{});
REQUIRE(std::is_same<E1::Links, L1>{});
}
SECTION("Setup") {
}
}