From 74724c32dd76dd46add430f75e7c032320633202 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 6 Mar 2007 21:51:06 +0000 Subject: [PATCH] testing the zip algorithm with unused arg [SVN r37151] --- test/Jamfile | 1 + test/algorithm/zip_ignore.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/algorithm/zip_ignore.cpp diff --git a/test/Jamfile b/test/Jamfile index 88c225c8..4c50e0a4 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -41,6 +41,7 @@ import testing ; [ run algorithm/join.cpp : : : : ] [ run algorithm/zip.cpp : : : : ] [ run algorithm/zip2.cpp : : : : ] + [ run algorithm/zip_ignore.cpp : : : : ] [ run sequence/as_list.cpp : : : : ] [ run sequence/as_map.cpp : : : : ] diff --git a/test/algorithm/zip_ignore.cpp b/test/algorithm/zip_ignore.cpp new file mode 100644 index 00000000..cd71ed44 --- /dev/null +++ b/test/algorithm/zip_ignore.cpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost::fusion; + { + vector iv(1,2); + vector cv('a', 'b'); + BOOST_TEST(at_c<0>(at_c<0>(zip(iv, unused, cv))) == 1); + BOOST_TEST(at_c<2>(at_c<0>(zip(iv, unused, cv))) == 'a'); + + BOOST_TEST(at_c<0>(at_c<1>(zip(iv, unused, cv))) == 2); + BOOST_TEST(at_c<2>(at_c<1>(zip(iv, unused, cv))) == 'b'); + } + return boost::report_errors(); +}