| 123456789101112131415161718 |
- //
- // fold_test.cxx
- // stream-test
- //
- // Created by Sam Jaffe on 4/5/23.
- //
- #include "stream/algorithm/fold.h"
- #include "stream_helpers.h"
- #include "stream_matchers.h"
- TEST(FoldLeft, DifferentInitMakesDifferentResult) {
- std::vector<int> const input{1, 2, 3, 4, 5};
- EXPECT_THAT(ranges::fold_left(input, 0, std::multiplies<>()), 0);
- EXPECT_THAT(ranges::fold_left(input, 1, std::multiplies<>()), 120);
- }
|