Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/xpressive/test/test_non_char.cpp @ 69

Last change on this file since 69 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.0 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2// test_non_char.cpp
3//
4//  Copyright 2004 Eric Niebler. Distributed under the Boost
5//  Software License, Version 1.0. (See accompanying file
6//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
8#include <algorithm>
9#include <boost/xpressive/traits/null_regex_traits.hpp>
10#include "./test.hpp"
11
12///////////////////////////////////////////////////////////////////////////////
13// test_main
14//   read the tests from the input file and execute them
15int test_main( int, char*[] )
16{
17    static int const data[] = {0, 1, 2, 3, 4, 5, 6};
18    null_regex_traits<int> nul;
19    basic_regex<int const *> rex = imbue(nul)(1 >> +((set= 2,3) | 4) >> 5);
20    match_results<int const *> what;
21
22    if(!regex_search(data, data + (sizeof(data)/sizeof(*data)), what, rex))
23    {
24        BOOST_ERROR("regex_search on integral data failed");
25    }
26    else
27    {
28        BOOST_CHECK(*what[0].first == 1);
29        BOOST_CHECK(*what[0].second == 6);
30    }
31
32    return 0;
33}
Note: See TracBrowser for help on using the repository browser.