#include <boost/core/lightweight_test.hpp>
#include <boost/histogram/axis/ostream.hpp>
#include <boost/histogram/axis/regular.hpp>
-#include <boost/histogram/detail/cat.hpp>
#include <limits>
#include <sstream>
#include <type_traits>
#include "std_ostream.hpp"
#include "throw_exception.hpp"
#include "utility_axis.hpp"
-
-using namespace boost::histogram;
-namespace tr = axis::transform;
-using def = use_default;
+#include "utility_str.hpp"
int main() {
+ using namespace boost::histogram;
+ using def = use_default;
+ namespace tr = axis::transform;
+
BOOST_TEST(std::is_nothrow_move_assignable<axis::regular<>>::value);
+ BOOST_TEST(std::is_nothrow_move_constructible<axis::regular<>>::value);
// bad_ctors
{
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 4);
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 4);
- BOOST_TEST_EQ(detail::cat(a),
+ BOOST_TEST_EQ(str(a),
"regular(4, -2, 2, metadata=\"bar\", options=underflow | overflow)");
}
BOOST_TEST_THROWS((axis::regular<double, tr::log>{2, -1, 0}), std::invalid_argument);
- BOOST_TEST_EQ(detail::cat(a), "regular_log(2, 1, 100, options=underflow | overflow)");
+ BOOST_TEST_EQ(str(a), "regular_log(2, 1, 100, options=underflow | overflow)");
}
// with sqrt transform
BOOST_TEST_EQ(a.index(100), 2);
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
- BOOST_TEST_EQ(detail::cat(a), "regular_sqrt(2, 0, 4, options=underflow | overflow)");
+ BOOST_TEST_EQ(str(a), "regular_sqrt(2, 0, 4, options=underflow | overflow)");
}
// with pow transform
BOOST_TEST_EQ(a.index(100), 2);
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
- BOOST_TEST_EQ(detail::cat(a),
+ BOOST_TEST_EQ(str(a),
"regular_pow(2, 0, 4, options=underflow | overflow, power=0.5)");
}
// null_type streamable
{
auto a = axis::regular<float, def, axis::null_type>(2, 0, 1);
- BOOST_TEST_EQ(detail::cat(a), "regular(2, 0, 1, options=underflow | overflow)");
+ BOOST_TEST_EQ(str(a), "regular(2, 0, 1, options=underflow | overflow)");
}
// shrink and rebin