diff options
Diffstat (limited to 'tests/auto/corelib/global/qglobal/tst_qglobal.cpp')
-rw-r--r-- | tests/auto/corelib/global/qglobal/tst_qglobal.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index bb6ec1c8e7..083526fdc4 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -102,6 +102,13 @@ void tst_QGlobal::for_each() QCOMPARE(i, counter++); } QCOMPARE(counter, list.count()); + + // check whether we can use a lambda + counter = 0; + foreach (int i, [&](){ return list; }()) { + QCOMPARE(i, counter++); + } + QCOMPARE(counter, list.count()); } void tst_QGlobal::qassert() |