mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Add unit tests for the nested seq and all compositions
This commit is contained in:
parent
b50c2bf8a8
commit
deb798118c
@ -24,6 +24,10 @@
|
|||||||
#ifndef TEST_CONTINUABLE_CONNECTION_HPP__
|
#ifndef TEST_CONTINUABLE_CONNECTION_HPP__
|
||||||
#define TEST_CONTINUABLE_CONNECTION_HPP__
|
#define TEST_CONTINUABLE_CONNECTION_HPP__
|
||||||
|
|
||||||
|
#include <tuple>
|
||||||
|
#include <type_traits>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <test-continuable.hpp>
|
#include <test-continuable.hpp>
|
||||||
|
|
||||||
template <typename Supplier, typename OperatorConnector>
|
template <typename Supplier, typename OperatorConnector>
|
||||||
@ -62,6 +66,25 @@ void test_all_seq_aggregate(Supplier&& supply, AggregateConnector&& ag) {
|
|||||||
EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3, 4, 5, 6);
|
EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3, 4, 5, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto chain =
|
||||||
|
ag(std::make_tuple(supply(1, 2), std::make_tuple(supply(3, 4))),
|
||||||
|
supply(5, 6));
|
||||||
|
EXPECT_ASYNC_RESULT(std::move(chain),
|
||||||
|
std::make_tuple(1, 2, std::make_tuple(3, 4)), 5, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
using type_t = decltype(
|
||||||
|
std::declval<Supplier>()(std::declval<int>(), std::declval<int>()));
|
||||||
|
|
||||||
|
auto chain = ag(std::make_tuple(
|
||||||
|
std::vector<type_t>{supply(1, 2), supply(3, 4), supply(5, 6)}));
|
||||||
|
EXPECT_ASYNC_RESULT(std::move(chain),
|
||||||
|
std::make_tuple(std::vector<std::tuple<int, int>>{
|
||||||
|
{1, 2}, {3, 4}, {5, 6}}));
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto chain =
|
auto chain =
|
||||||
ag(supply(1, 2), supply(non_default_constructible{1}), supply(5, 6));
|
ag(supply(1, 2), supply(non_default_constructible{1}), supply(5, 6));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user