39 const Container kEmptyCollection = Container();
40 auto permutations = Permutations<Container, Const_IT>(kEmptyCollection.begin(), kEmptyCollection.end());
41 EXPECT_EQ(0, permutations.size());
46 const Container kUnicCollection = Container(1,10);
47 auto permutations = Permutations<Container, Const_IT>(kUnicCollection.end(), kUnicCollection.begin());
48 EXPECT_EQ(0, permutations.size());
53 const Container kUnicCollection = Container(1,10);
54 auto permutations = Permutations<Container, Const_IT>(kUnicCollection.begin(), kUnicCollection.end());
55 EXPECT_EQ(1, permutations.size());
56 EXPECT_EQ(1, permutations.begin()->size());
57 EXPECT_EQ(10, *(permutations.begin()->begin()));
62 const Container kSameElCollection = Container(3,10);
63 auto permutations = Permutations<Container, Const_IT>(kSameElCollection.begin(), kSameElCollection.end());
64 EXPECT_EQ(6, permutations.size());
65 for (
auto it = permutations.begin(); it != permutations.end(); ++it)
67 EXPECT_EQ(3, it->size());
68 for (Container::const_iterator itEl = it->begin(); itEl != it->end(); ++itEl)
75 const Container kSmallArray(SmallIntArray, SmallIntArray +
sizeof(SmallIntArray) /
76 sizeof(Container::value_type));
77 auto permutations = Permutations<Container, Const_IT>(kSmallArray.begin(), kSmallArray.end());
78 EXPECT_EQ(6, permutations.size());
79 for (
auto it = permutations.begin(); it != permutations.end(); ++it)
80 EXPECT_EQ(3, it->size());
85 const std::string abcStr =
"abc";
86 std::list<std::string> permutations =
87 Permutations<std::string, std::string::const_iterator>(abcStr.begin(), abcStr.end());
88 EXPECT_EQ(6, permutations.size());
89 for (std::list<std::string>::const_iterator it = permutations.begin(); it != permutations.end(); ++it)
90 EXPECT_EQ(3, it->size());