41 const Container kEmptyCollection = Container();
42 List combinations = Combinations<Container, Const_IT>(kEmptyCollection.begin(), kEmptyCollection.end());
43 EXPECT_EQ(static_cast<size_t>(0), combinations.size());
48 const Container kUnicCollection = Container(1, 10);
49 List combinations = Combinations<Container, Const_IT>(kUnicCollection.end(), kUnicCollection.begin());
50 EXPECT_EQ(static_cast<size_t>(0), combinations.size());
55 const Container kUnicCollection = Container(1, 10);
56 List combinations = Combinations<Container, Const_IT>(kUnicCollection.begin(), kUnicCollection.end());
57 EXPECT_EQ(static_cast<size_t>(1), combinations.size());
58 EXPECT_EQ(static_cast<size_t>(1), combinations.begin()->size());
59 EXPECT_EQ(10, *(combinations.begin()->begin()));
64 const Container kSmallArray(SmallIntArray, SmallIntArray +
sizeof(SmallIntArray) /
sizeof(Value));
65 List combinations = Combinations<Container, Const_IT>(kSmallArray.begin(), kSmallArray.end());
66 EXPECT_EQ(static_cast<size_t>(7), combinations.size());
69 for (List::const_iterator it = combinations.begin(); it != combinations.end(); ++it)
70 countEls += static_cast<int>(it->size());
71 EXPECT_EQ(12, countEls);
77 const std::string abcStr =
"abc";
78 std::list<std::string> combinations =
79 Combinations<std::string, std::string::const_iterator>(abcStr.begin(), abcStr.end());
80 EXPECT_EQ(static_cast<size_t>(7), combinations.size());
83 for (std::list<std::string>::const_iterator it = combinations.begin(); it != combinations.end(); ++it)
84 countEls += static_cast<int>(it->size());
85 EXPECT_EQ(12, countEls);