7 #include <boost/test/auto_unit_test.hpp>
19 BOOST_CHECK_EQUAL(
"2", m.to_string());
21 BOOST_CHECK_EQUAL(
"1", m.to_string());
23 BOOST_CHECK_EQUAL(
"1", x.to_string());
29 std::stringstream stream;
38 BOOST_CHECK_EQUAL(
number(1), n1);
39 BOOST_CHECK_EQUAL(
number(2), n2);
73 BOOST_CHECK_EQUAL(
number(3), c);
80 BOOST_CHECK_EQUAL(
number(1), c);
87 BOOST_CHECK_EQUAL(
number(6), c);
97 BOOST_CHECK_EQUAL(
number(2.5), c);
106 BOOST_CHECK_EQUAL(number(1), a);
109 BOOST_CHECK_EQUAL(number(1), a);
111 BOOST_CHECK_EQUAL(half, a);
113 BOOST_CHECK_EQUAL(number(1), a);
std::string to_string() const
BOOST_AUTO_TEST_CASE(test_basics)
BOOST_AUTO_TEST_SUITE_END()
Represent a rational number (fraction) as a numerator and denominator.
void save(std::ostream &stream) const
BOOST_AUTO_TEST_SUITE(node_test)