iota_test.cxx 547 B

12345678910111213141516171819202122232425
  1. //
  2. // iota_test.cxx
  3. // stream-test
  4. //
  5. // Created by Sam Jaffe on 4/5/23.
  6. //
  7. #include "stream/view/iota.h"
  8. #include "stream_helpers.h"
  9. #include "stream_matchers.h"
  10. TEST(IotaView, ConcreteHasEmpty) {
  11. auto range = views::iota(0, 4);
  12. static_assert(stream::detail::has_empty_v<decltype(range)>);
  13. }
  14. TEST(IotaView, ConcreteHasSize) {
  15. auto range = views::iota(0, 4);
  16. static_assert(stream::detail::has_size_v<decltype(range)>);
  17. }
  18. TEST(IotaView, CountsFromStartToEnd) {
  19. EXPECT_THAT(views::iota(0, 4), RangesEq(std::vector{0, 1, 2, 3}));
  20. }