@@ -20,13 +20,12 @@ TEST(CombinationGenerator, Square) {
20
20
const std::vector<std::vector<int >> Choices{{0 , 1 }, {2 , 3 }};
21
21
22
22
std::vector<std::vector<int >> Variants;
23
- CombinationGenerator<int , std::vector<int >, 4 > G (
24
- Choices, [&](ArrayRef<int > State) -> bool {
25
- Variants.emplace_back (State);
26
- return false ; // keep going
27
- });
23
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
28
24
const size_t NumVariants = G.numCombinations ();
29
- G.generate ();
25
+ G.generate ([&](ArrayRef<int > State) -> bool {
26
+ Variants.emplace_back (State);
27
+ return false ; // keep going
28
+ });
30
29
31
30
const std::vector<std::vector<int >> ExpectedVariants{
32
31
{0 , 2 },
@@ -42,13 +41,12 @@ TEST(CombinationGenerator, MiddleColumn) {
42
41
const std::vector<std::vector<int >> Choices{{0 }, {1 , 2 }, {3 }};
43
42
44
43
std::vector<std::vector<int >> Variants;
45
- CombinationGenerator<int , std::vector<int >, 4 > G (
46
- Choices, [&](ArrayRef<int > State) -> bool {
47
- Variants.emplace_back (State);
48
- return false ; // keep going
49
- });
44
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
50
45
const size_t NumVariants = G.numCombinations ();
51
- G.generate ();
46
+ G.generate ([&](ArrayRef<int > State) -> bool {
47
+ Variants.emplace_back (State);
48
+ return false ; // keep going
49
+ });
52
50
53
51
const std::vector<std::vector<int >> ExpectedVariants{
54
52
{0 , 1 , 3 },
@@ -62,13 +60,12 @@ TEST(CombinationGenerator, SideColumns) {
62
60
const std::vector<std::vector<int >> Choices{{0 , 1 }, {2 }, {3 , 4 }};
63
61
64
62
std::vector<std::vector<int >> Variants;
65
- CombinationGenerator<int , std::vector<int >, 4 > G (
66
- Choices, [&](ArrayRef<int > State) -> bool {
67
- Variants.emplace_back (State);
68
- return false ; // keep going
69
- });
63
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
70
64
const size_t NumVariants = G.numCombinations ();
71
- G.generate ();
65
+ G.generate ([&](ArrayRef<int > State) -> bool {
66
+ Variants.emplace_back (State);
67
+ return false ; // keep going
68
+ });
72
69
73
70
const std::vector<std::vector<int >> ExpectedVariants{
74
71
{0 , 2 , 3 },
@@ -84,13 +81,12 @@ TEST(CombinationGenerator, LeftColumn) {
84
81
const std::vector<std::vector<int >> Choices{{0 , 1 }, {2 }};
85
82
86
83
std::vector<std::vector<int >> Variants;
87
- CombinationGenerator<int , std::vector<int >, 4 > G (
88
- Choices, [&](ArrayRef<int > State) -> bool {
89
- Variants.emplace_back (State);
90
- return false ; // keep going
91
- });
84
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
92
85
const size_t NumVariants = G.numCombinations ();
93
- G.generate ();
86
+ G.generate ([&](ArrayRef<int > State) -> bool {
87
+ Variants.emplace_back (State);
88
+ return false ; // keep going
89
+ });
94
90
95
91
const std::vector<std::vector<int >> ExpectedVariants{
96
92
{0 , 2 },
@@ -104,13 +100,12 @@ TEST(CombinationGenerator, RightColumn) {
104
100
const std::vector<std::vector<int >> Choices{{0 }, {1 , 2 }};
105
101
106
102
std::vector<std::vector<int >> Variants;
107
- CombinationGenerator<int , std::vector<int >, 4 > G (
108
- Choices, [&](ArrayRef<int > State) -> bool {
109
- Variants.emplace_back (State);
110
- return false ; // keep going
111
- });
103
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
112
104
const size_t NumVariants = G.numCombinations ();
113
- G.generate ();
105
+ G.generate ([&](ArrayRef<int > State) -> bool {
106
+ Variants.emplace_back (State);
107
+ return false ; // keep going
108
+ });
114
109
115
110
const std::vector<std::vector<int >> ExpectedVariants{
116
111
{0 , 1 },
@@ -124,13 +119,12 @@ TEST(CombinationGenerator, Column) {
124
119
const std::vector<std::vector<int >> Choices{{0 , 1 }};
125
120
126
121
std::vector<std::vector<int >> Variants;
127
- CombinationGenerator<int , std::vector<int >, 4 > G (
128
- Choices, [&](ArrayRef<int > State) -> bool {
129
- Variants.emplace_back (State);
130
- return false ; // keep going
131
- });
122
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
132
123
const size_t NumVariants = G.numCombinations ();
133
- G.generate ();
124
+ G.generate ([&](ArrayRef<int > State) -> bool {
125
+ Variants.emplace_back (State);
126
+ return false ; // keep going
127
+ });
134
128
135
129
const std::vector<std::vector<int >> ExpectedVariants{
136
130
{0 },
@@ -144,13 +138,12 @@ TEST(CombinationGenerator, Row) {
144
138
const std::vector<std::vector<int >> Choices{{0 }, {1 }};
145
139
146
140
std::vector<std::vector<int >> Variants;
147
- CombinationGenerator<int , std::vector<int >, 4 > G (
148
- Choices, [&](ArrayRef<int > State) -> bool {
149
- Variants.emplace_back (State);
150
- return false ; // keep going
151
- });
141
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
152
142
const size_t NumVariants = G.numCombinations ();
153
- G.generate ();
143
+ G.generate ([&](ArrayRef<int > State) -> bool {
144
+ Variants.emplace_back (State);
145
+ return false ; // keep going
146
+ });
154
147
155
148
const std::vector<std::vector<int >> ExpectedVariants{
156
149
{0 , 1 },
@@ -163,13 +156,12 @@ TEST(CombinationGenerator, Singleton) {
163
156
const std::vector<std::vector<int >> Choices{{0 }};
164
157
165
158
std::vector<std::vector<int >> Variants;
166
- CombinationGenerator<int , std::vector<int >, 4 > G (
167
- Choices, [&](ArrayRef<int > State) -> bool {
168
- Variants.emplace_back (State);
169
- return false ; // keep going
170
- });
159
+ CombinationGenerator<int , std::vector<int >, 4 > G (Choices);
171
160
const size_t NumVariants = G.numCombinations ();
172
- G.generate ();
161
+ G.generate ([&](ArrayRef<int > State) -> bool {
162
+ Variants.emplace_back (State);
163
+ return false ; // keep going
164
+ });
173
165
174
166
const std::vector<std::vector<int >> ExpectedVariants{
175
167
{0 },
0 commit comments