From 7b0d8258a5ed8a0846cad5d7287c012aaf7ea361 Mon Sep 17 00:00:00 2001 From: Thomas Hahn Date: Fri, 29 Sep 2023 11:33:52 -0400 Subject: [PATCH] Add test for strided range --- test/c++/itertools.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/c++/itertools.cpp b/test/c++/itertools.cpp index 3b093c1..5438aec 100644 --- a/test/c++/itertools.cpp +++ b/test/c++/itertools.cpp @@ -201,6 +201,12 @@ TEST(Itertools, Product_Range) { EXPECT_EQ(res, 1000); } +TEST(Itertools, Stride) { + std::vector V1{0, 1, 2, 3, 4}; + int i = 0; + for (auto x : stride(V1, 1)) EXPECT_EQ(i++, x); +} + int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();