diff --git a/test/unit-test/test-continuable-connection-seq.cpp b/test/unit-test/test-continuable-connection-seq.cpp index 7975ad5..4db38d6 100644 --- a/test/unit-test/test-continuable-connection-seq.cpp +++ b/test/unit-test/test-continuable-connection-seq.cpp @@ -24,48 +24,45 @@ #include "test-continuable.hpp" TYPED_TEST(single_dimension_tests, is_logical_seq_connectable) { - - { - auto chain = this->supply() >> this->supply(); - EXPECT_ASYNC_RESULT(std::move(chain)); - } - - { - auto chain = this->supply(1) >> this->supply(2); - EXPECT_ASYNC_RESULT(std::move(chain), 1, 2); - } - - { - auto chain = cti::when_seq(this->supply(1), this->supply(2), this->supply(3)); - EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3); - } - - { - auto chain = this->supply(1, 2) >> this->supply(3, 4); - EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3, 4); - } - - { - auto chain = this->supply(tag1{}, tag2{}) >> this->supply(tag1{}, tag2{}); - ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag1, tag2); - } - - { - auto chain = this->supply(tag1{}, tag2{}, tag3{}) >> - this->supply(tag1{}, tag2{}, tag3{}); - ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3, tag1, tag2, tag3); - } - - { - // Check the evaluation order - unsigned i = 0; - auto composed = - make_step(this, i, 0) >> make_step(this, i, 1) >> make_step(this, i, 2); - EXPECT_ASYNC_RESULT(std::move(composed)); - } - - { - auto chain = this->supply('a') >> this->supply('b') >> this->supply('c'); - EXPECT_ASYNC_RESULT(std::move(chain), 'a', 'b', 'c'); - } + auto chain = this->supply() >> this->supply(); + EXPECT_ASYNC_RESULT(std::move(chain)); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_value) { + auto chain = this->supply(1) >> this->supply(2); + EXPECT_ASYNC_RESULT(std::move(chain), 1, 2); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_when_seq) { + auto chain = cti::when_seq(this->supply(1), this->supply(2), this->supply(3)); + EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_duplicated_val) { + auto chain = this->supply(1, 2) >> this->supply(3, 4); + EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3, 4); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_tag) { + auto chain = this->supply(tag1{}, tag2{}) >> this->supply(tag1{}, tag2{}); + ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag1, tag2); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_three_tags) { + auto chain = this->supply(tag1{}, tag2{}, tag3{}) >> + this->supply(tag1{}, tag2{}, tag3{}); + ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3, tag1, tag2, tag3); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_composed) { + // Check the evaluation order + unsigned i = 0; + auto composed = + make_step(this, i, 0) >> make_step(this, i, 1) >> make_step(this, i, 2); + EXPECT_ASYNC_RESULT(std::move(composed)); +} + +TYPED_TEST(single_dimension_tests, is_logical_seq_connectable_chars) { + auto chain = this->supply('a') >> this->supply('b') >> this->supply('c'); + EXPECT_ASYNC_RESULT(std::move(chain), 'a', 'b', 'c'); }