subrange_test.cxx 387 B

123456789101112131415161718
  1. //
  2. // subrange_test.cxx
  3. // stream-test
  4. //
  5. // Created by Sam Jaffe on 4/6/23.
  6. //
  7. #include "stream/view/subrange.h"
  8. #include "stream_helpers.h"
  9. #include "stream_matchers.h"
  10. TEST(SubrangeView, CanBuildFromIterators) {
  11. std::vector<int> input{1, 2, 3, 4, 5};
  12. auto range = ranges::subrange(input.begin() + 1, input.begin() + 3);
  13. EXPECT_THAT(range, RangesEq(std::vector{2, 3}));
  14. }