#include "OstreamTest.h" #include <alib/set> #include <alib/vector> #include <alib/pair> #include <sstream> CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( OstreamTest, "bits" ); CPPUNIT_TEST_SUITE_REGISTRATION( OstreamTest ); void OstreamTest::setUp() { } void OstreamTest::tearDown() { } void OstreamTest::testOstream() { ext::vector<int> vector1 {1, 2, 3}; ext::vector<int> vector2 {2, 3, 4}; std::stringstream ss1; ss1 << vector1; std::cout << ss1.str() << std::endl; CPPUNIT_ASSERT("[1, 2, 3]" == ss1.str()); ext::set<ext::vector<int>> set1 {vector1}; ext::set<ext::vector<int>> set2 {vector2}; std::stringstream ss2; ss2 << set1; std::cout << ss2.str() << std::endl; CPPUNIT_ASSERT("{[1, 2, 3]}" == ss2.str()); ext::pair<ext::set<ext::vector<int>>, ext::set<ext::vector<int>>> pair1 {set1, set2}; ext::pair<ext::set<ext::vector<int>>, ext::set<ext::vector<int>>> pair2 {set2, set1}; std::stringstream ss3; ss3 << pair1; std::cout << ss3.str() << std::endl; CPPUNIT_ASSERT("({[1, 2, 3]}, {[2, 3, 4]})" == ss3.str()); }