File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,34 @@ SCENARIO("range tests", "[core][util][range]")
217
217
}
218
218
}
219
219
}
220
+ GIVEN (" A constant vectors of int and a list of strings." )
221
+ {
222
+ const std::vector<int > int_vector{41 , 27 };
223
+ const std::list<std::string> string_list{" boo" , " far" };
224
+ WHEN (" We zip the vector and the list" )
225
+ {
226
+ auto range = make_range (int_vector).zip (string_list);
227
+ REQUIRE (!range.empty ());
228
+ THEN (" First pair is (1, foo)" )
229
+ {
230
+ const std::pair<int , std::string> first_pair = *range.begin ();
231
+ REQUIRE (first_pair.first == 41 );
232
+ REQUIRE (first_pair.second == " boo" );
233
+ }
234
+ range = std::move (range).drop (1 );
235
+ THEN (" Second pair is (2, bar)" )
236
+ {
237
+ const std::pair<int , std::string> second_pair = *range.begin ();
238
+ REQUIRE (second_pair.first == 27 );
239
+ REQUIRE (second_pair.second == " far" );
240
+ }
241
+ range = std::move (range).drop (1 );
242
+ THEN (" Range is empty" )
243
+ {
244
+ REQUIRE (range.empty ());
245
+ }
246
+ }
247
+ }
220
248
}
221
249
222
250
class move_onlyt
You can’t perform that action at this time.
0 commit comments