additional zip tests for variable length input sequences

[SVN r35516]
This commit is contained in:
Dan Marsden
2006-10-07 15:40:49 +00:00
parent 114556bbba
commit 7cd89c8d9c
2 changed files with 32 additions and 0 deletions

View File

@ -40,6 +40,7 @@ import testing ;
[ run algorithm/transform.cpp : : : : ] [ run algorithm/transform.cpp : : : : ]
[ run algorithm/join.cpp : : : : ] [ run algorithm/join.cpp : : : : ]
[ run algorithm/zip.cpp : : : : ] [ run algorithm/zip.cpp : : : : ]
[ run algorithm/zip2.cpp : : : : ]
[ run sequence/as_list.cpp : : : : ] [ run sequence/as_list.cpp : : : : ]
[ run sequence/as_map.cpp : : : : ] [ run sequence/as_map.cpp : : : : ]

31
test/algorithm/zip2.cpp Normal file
View File

@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Use, modification and distribution is subject to 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 <boost/detail/lightweight_test.hpp>
#include <boost/fusion/algorithm/transformation/zip.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/adapted/mpl.hpp>
#include <boost/mpl/vector.hpp>
int main()
{
using namespace boost::fusion;
{
const vector2<int,int> shorter(1,2);
const vector3<char,char,char> longer('a', 'b', 'c');
const vector2<vector2<int,char>, vector2<int,char> > result(vector2<int,char>(1,'a'), vector2<int,char>(2,'b'));
BOOST_TEST(zip(shorter, longer) == result);
}
{
const vector3<int,int,int> longer(1,2,3);
const vector2<char,char> shorter('a', 'b');
const vector2<vector2<int,char>, vector2<int,char> > result(vector2<int,char>(1,'a'), vector2<int,char>(2,'b'));
BOOST_TEST(zip(longer, shorter) == result);
}
return boost::report_errors();
}