Skip to content

Commit

Permalink
Add test for strided range
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoemi09 committed Sep 29, 2023
1 parent ca4cd2e commit 7b0d825
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/c++/itertools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ TEST(Itertools, Product_Range) {
EXPECT_EQ(res, 1000);
}

TEST(Itertools, Stride) {
std::vector<int> 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();
Expand Down

0 comments on commit 7b0d825

Please sign in to comment.