stream_insert.pass.cpp [plain text]
#include <string>
#include <sstream>
#include <cassert>
int main()
{
{
std::ostringstream out;
std::string s("some text");
out << s;
assert(out.good());
assert(s == out.str());
}
{
std::ostringstream out;
std::string s("some text");
out.width(12);
out << s;
assert(out.good());
assert(" " + s == out.str());
}
{
std::wostringstream out;
std::wstring s(L"some text");
out << s;
assert(out.good());
assert(s == out.str());
}
{
std::wostringstream out;
std::wstring s(L"some text");
out.width(12);
out << s;
assert(out.good());
assert(L" " + s == out.str());
}
}