mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Split the chaining tests into multiple ones
This commit is contained in:
parent
2008f006a0
commit
b8ff4c4c18
@ -1,9 +1,3 @@
|
|||||||
if (${MSVC_VERSION} LESS 1900)
|
|
||||||
message(FATAL_ERROR "You are using an unsupported version of Visual Studio "
|
|
||||||
"which doesn't support all required C++11 features. "
|
|
||||||
"(Visual Studio 2015 (version >= 1900) is required!)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
if(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||||
set(PLATFORM 64)
|
set(PLATFORM 64)
|
||||||
else()
|
else()
|
||||||
@ -14,7 +8,7 @@ if (PLATFORM EQUAL 64)
|
|||||||
add_definitions("-D_WIN64")
|
add_definitions("-D_WIN64")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP /bigobj")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP1 /bigobj")
|
||||||
|
|
||||||
if (TESTS_NO_EXCEPTIONS)
|
if (TESTS_NO_EXCEPTIONS)
|
||||||
add_definitions(-D_HAS_EXCEPTIONS=0)
|
add_definitions(-D_HAS_EXCEPTIONS=0)
|
||||||
|
|||||||
@ -30,41 +30,36 @@ TYPED_TEST(single_dimension_tests, are_chainable) {
|
|||||||
EXPECT_ASYNC_RESULT(this->supply().then([] {
|
EXPECT_ASYNC_RESULT(this->supply().then([] {
|
||||||
return; // void
|
return; // void
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
// Type chain
|
|
||||||
{
|
TYPED_TEST(single_dimension_tests, are_type_chainable) {
|
||||||
auto chain = this->supply().then([] { return tag1{}; });
|
auto chain = this->supply().then([] { return tag1{}; });
|
||||||
ASSERT_ASYNC_TYPES(std::move(chain), tag1);
|
ASSERT_ASYNC_TYPES(std::move(chain), tag1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pair chain
|
TYPED_TEST(single_dimension_tests, are_pair_chainable) {
|
||||||
{
|
auto chain = this->supply().then([] {
|
||||||
auto chain = this->supply().then([] {
|
// ...
|
||||||
// ...
|
return std::make_pair(tag1{}, tag2{});
|
||||||
return std::make_pair(tag1{}, tag2{});
|
});
|
||||||
});
|
ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2);
|
||||||
ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2);
|
}
|
||||||
}
|
|
||||||
|
TYPED_TEST(single_dimension_tests, are_tuple_chainable) {
|
||||||
// Tuple chain
|
auto chain = this->supply().then([] {
|
||||||
{
|
// ...
|
||||||
auto chain = this->supply().then([] {
|
return std::make_tuple(tag1{}, tag2{}, tag3{});
|
||||||
// ...
|
});
|
||||||
return std::make_tuple(tag1{}, tag2{}, tag3{});
|
ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3);
|
||||||
});
|
}
|
||||||
ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3);
|
|
||||||
}
|
TYPED_TEST(single_dimension_tests, are_erasing_chainable) {
|
||||||
|
auto chain = this->supply().then(this->supply(tag1{}));
|
||||||
// Erasing chain
|
ASSERT_ASYNC_TYPES(std::move(chain), tag1);
|
||||||
{
|
}
|
||||||
auto chain = this->supply().then(this->supply(tag1{}));
|
|
||||||
ASSERT_ASYNC_TYPES(std::move(chain), tag1);
|
TYPED_TEST(single_dimension_tests, are_continuing_chainable) {
|
||||||
}
|
auto chain = this->supply().then([&] { return this->supply(tag1{}); });
|
||||||
|
|
||||||
// Continuing chain
|
ASSERT_ASYNC_TYPES(std::move(chain), tag1);
|
||||||
{
|
|
||||||
auto chain = this->supply().then([&] { return this->supply(tag1{}); });
|
|
||||||
|
|
||||||
ASSERT_ASYNC_TYPES(std::move(chain), tag1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user