15 #include <gmock/gmock.h>
16 #include <gtest/gtest.h>
23 #include <range/v3/range/conversion.hpp>
24 #include <range/v3/view/take_exactly.hpp>
34 TEST(PropagateAction, DefaultExecutionPolicy) {
37 ASSERT_EQ(input.front(), std::make_tuple(6, 1.0));
40 TEST(PropagateAction, SequencedExecutionPolicy) {
43 ASSERT_EQ(input.front(), std::make_tuple(6, 1.0));
46 TEST(PropagateAction, ParallelExecutionPolicy) {
49 ASSERT_EQ(input.front(), std::make_tuple(6, 1.0));
52 TEST(PropagateAction, Composition) {
56 ranges::views::take_exactly(5) |
59 ASSERT_THAT(
states, testing::ElementsAre(4, 4, 4, 4, 4));
62 TEST(PropagateAction, StatefulModel) {
64 auto model = [value = 0](int)
mutable {
return value++; };
66 ranges::views::take_exactly(5) |
70 ASSERT_THAT(
states, testing::ElementsAre(0, 1, 2, 3, 4));
71 ASSERT_EQ(model(0), 5);