X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FFormat.test.cc;h=8dd4bae24e6cb67c370e01a9e1888fada1d2fc05;hb=209950ee5f6898978cd68614ef339ae3531c5c53;hp=ece8647c32dbbc039126cfe47ce9937d92527e8b;hpb=767a76da8e5b96a69b620e44d32e0a1b04005679;p=senf.git diff --git a/senf/Utils/Format.test.cc b/senf/Utils/Format.test.cc index ece8647..8dd4bae 100644 --- a/senf/Utils/Format.test.cc +++ b/senf/Utils/Format.test.cc @@ -149,6 +149,31 @@ SENF_AUTO_UNIT_TEST(dumpint) # undef CheckFormat } +namespace { + void f1(std::ostream & os) { + senf::format::IndentHelper indent; + os << indent << "f1\n"; + } + void f2(std::ostream & os) { + senf::format::IndentHelper indent; + os << indent << "f2_1\n"; + f1( os); + os << indent << "f2_2\n"; + indent.increase(); + os << indent << "f2_3\n"; + } +} +SENF_AUTO_UNIT_TEST(indent) +{ + std::stringstream ss; + f2(ss); + BOOST_CHECK_EQUAL( ss.str(), + " f2_1\n" + " f1\n" + " f2_2\n" + " f2_3\n"); +} + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_