aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/iterator/ut/zip_ut.cpp
blob: 3ef45d30dcb13912ae1adcf113d61cef105f3bc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <library/cpp/iterator/zip.h> 
 
#include <library/cpp/testing/gtest/gtest.h> 
 
#include <util/generic/vector.h> 
 
TEST(TIterator, ZipSimplePostIncrement) { 
    TVector<int> left{1, 2, 3}; 
    TVector<int> right{4, 5, 6}; 
 
    auto zipped = Zip(left, right); 
    auto cur = zipped.begin(); 
    auto last = zipped.end(); 
 
    { 
        auto first = *(cur++); 
        EXPECT_EQ(std::get<0>(first), 1); 
        EXPECT_EQ(std::get<1>(first), 4); 
    } 
    { 
        auto second = *(cur++); 
        EXPECT_EQ(std::get<0>(second), 2); 
        EXPECT_EQ(std::get<1>(second), 5); 
    } 
 
    EXPECT_EQ(std::next(cur), last); 
}