]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // ------------------------------------------------------------------------------ |
2 | // libs/format/test/format_test1.cpp : test constructing objects and basic parsing | |
3 | // ------------------------------------------------------------------------------ | |
4 | ||
5 | // Copyright Samuel Krempp 2003. Use, modification, and distribution are | |
6 | // subject to the Boost Software License, Version 1.0. (See accompanying | |
7 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | ||
9 | // See http://www.boost.org/libs/format for library home page | |
10 | ||
11 | // ------------------------------------------------------------------------------ | |
12 | ||
11fdf7f2 TL |
13 | #include <boost/detail/lightweight_test.hpp> |
14 | #include <boost/format.hpp> | |
7c673cae | 15 | |
11fdf7f2 | 16 | int main(int, char* []) |
7c673cae | 17 | { |
7c673cae FG |
18 | using boost::format; |
19 | using boost::str; | |
20 | ||
21 | if(str( format(" %% ") ) != " % ") | |
22 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
23 | if(str( format("nothing") ) != "nothing") | |
24 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
25 | if(str( format("%% ") ) != "% ") | |
26 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
27 | if(str( format(" %%") ) != " %") | |
28 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
29 | if(str( format(" %n ") ) != " ") | |
30 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
31 | if(str( format("%n ") ) != " ") | |
32 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
33 | if(str( format(" %n") ) != " ") | |
34 | BOOST_ERROR("Basic parsing without arguments Failed"); | |
35 | ||
36 | if(str( format("%%##%%##%%1 %1%00") % "Escaped OK" ) != "%##%##%1 Escaped OK00") | |
37 | BOOST_ERROR("Basic parsing Failed"); | |
38 | if(str( format("%%##%#x ##%%1 %s00") % 20 % "Escaped OK" ) != "%##0x14 ##%1 Escaped OK00") | |
39 | BOOST_ERROR("Basic p-parsing Failed") ; | |
40 | ||
11fdf7f2 | 41 | return boost::report_errors(); |
7c673cae | 42 | } |