LeechCraft
0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
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
25
QList<QPair<int, QString>
>
pairs
;
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
37
QList<QPair<int, QString>
>
pairs
;
38
for
(
const
auto
& pair : Views::
Zip
(
ints
,
strings
))
39
pairs
<< pair;
40
41
QCOMPARE
(
pairs
, (
Zip
(
ints
,
strings
)));
42
}
43
}
44
}
LC::Util::ViewsTest
Definition
viewstest.h:18
QList
Definition
ianrulesstorage.h:14
LC::Util::Filter
Container< T > Filter(const Container< T > &c, F f)
Definition
prelude.h:118
LC::Util::Zip
auto Zip(const Container< T1 > &c1, const Container< T2 > &c2) -> Container< Pair< T1, T2 > >
Definition
prelude.h:54
LC
Definition
constants.h:15
prelude.h
views.h
viewstest.h
src
util
sll
tests
viewstest.cpp
Generated by
1.10.0