1// Copyright 2021 Peter Dimov
2// Distributed under the Boost Software License, Version 1.0.
3// https://www.boost.org/LICENSE_1_0.txt
4
5#include <boost/describe/detail/pp_utilities.hpp>
6#include <boost/describe/detail/config.hpp>
7#include <boost/core/lightweight_test.hpp>
8
9#if !defined(BOOST_DESCRIBE_CXX11)
10
11#include <boost/config/pragma_message.hpp>
12
13BOOST_PRAGMA_MESSAGE("Skipping test because C++11 is not available")
14int main() {}
15
16#else
17
18#define S(x) S2(x)
19#define S2(x) S3(x)
20#define S3(x) #x
21
22char const * s1 = S((BOOST_DESCRIBE_PP_PARSE(x)));
23char const * s2 = S((BOOST_DESCRIBE_PP_PARSE(() y)));
24char const * s3 = S((BOOST_DESCRIBE_PP_PARSE((a) z)));
25char const * s4 = S((BOOST_DESCRIBE_PP_PARSE((a, b) w)));
26
27int main()
28{
29 BOOST_TEST_CSTR_EQ( s1, "(0, ~, x)" );
30 BOOST_TEST_CSTR_EQ( s2, "(1, (), y)" );
31 BOOST_TEST_CSTR_EQ( s3, "(1, (a), z)" );
32 BOOST_TEST_CSTR_EQ( s4, "(1, (a, b), w)" );
33
34 return boost::report_errors();
35}
36
37#endif // !defined(BOOST_DESCRIBE_CXX11)
38

source code of boost/libs/describe/test/pp_parse_test.cpp