LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
viewstest.cpp
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #include "viewstest.h"
10 #include <QtTest>
11 #include <views.h>
12 #include <prelude.h>
13 
14 QTEST_MAIN (LC::Util::ViewsTest)
15 
16 namespace LC
17 {
18 namespace Util
19 {
20  void ViewsTest::testZipView ()
21  {
22  QList<int> ints { 1, 2, 3 };
23  QList<QString> strings { "a", "b", "c" };
24 
26  for (const auto& pair : Views::Zip (ints, strings))
27  pairs << pair;
28 
29  QCOMPARE (pairs, (Zip (ints, strings)));
30  }
31 
32  void ViewsTest::testZipViewDifferentLengths ()
33  {
34  QList<int> ints { 1, 2, 3, 4, 5 };
35  QList<QString> strings { "a", "b", "c" };
36 
38  for (const auto& pair : Views::Zip (ints, strings))
39  pairs << pair;
40 
41  QCOMPARE (pairs, (Zip (ints, strings)));
42  }
43 }
44 }
QList
Definition: ianrulesstorage.h:14
LC::Util::Views::Zip
detail::ZipRange< typename C1::const_iterator, typename C2::const_iterator, PairType > Zip(const C1 &c1, const C2 &c2)
Definition: views.h:126
prelude.h
LC
Definition: constants.h:14
LC::Util::ViewsTest
Definition: viewstest.h:29
viewstest.h
LC::Util::Zip
auto Zip(const Container< T1 > &c1, const Container< T2 > &c2) -> Container< Pair< T1, T2 >>
Definition: prelude.h:60
views.h