xo-indentlog: tweaking utest to explore gcc 13 regression
This commit is contained in:
parent
9d3cae1dee
commit
f3f7e144eb
1 changed files with 80 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
/* @file fixed.test.cpp */
|
||||
|
||||
#include "xo/indentlog/scope.hpp"
|
||||
#include "xo/indentlog/print/quoted.hpp"
|
||||
//#include "xo/indentlog/print/tag.hpp"
|
||||
#include "xo/indentlog/print/hex.hpp"
|
||||
|
|
@ -26,6 +27,85 @@ namespace ut {
|
|||
std::string s_;
|
||||
}; /*quoted_tcase*/
|
||||
|
||||
TEST_CASE("sstream.1char", "[quoted]") {
|
||||
constexpr bool c_debug_flag = true;
|
||||
|
||||
scope log(XO_DEBUG2(c_debug_flag, "TEST_CASE.sstream"));
|
||||
|
||||
/* testing unexpected sstream behavior */
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
log && log("empty stream");
|
||||
|
||||
ss << '\\';
|
||||
|
||||
log && log("after: lone escaped backslash");
|
||||
log && log(hex_view(ss.view().begin(), ss.view().end(), true));
|
||||
|
||||
ss << 'n';
|
||||
|
||||
log && log("after: lone 'n' char");
|
||||
log && log(hex_view(ss.view().begin(), ss.view().end(), true));
|
||||
|
||||
log && log("ss.str()=[", ss.str(), "]");
|
||||
log && log("quoted(\"\\n\")=[", quoted("\\n"), "]");
|
||||
}
|
||||
|
||||
/* testing unexpected sstream behavior */
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
log && log("empty stream");
|
||||
|
||||
ss << "\\n";
|
||||
|
||||
log && log("after: '\\n' escaped backslash + n");
|
||||
log && log(hex_view(ss.view().begin(), ss.view().end(), true));
|
||||
}
|
||||
|
||||
/* testing unexpected sstream behavior */
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
log && log("empty stream");
|
||||
|
||||
ss << quoted("\n");
|
||||
|
||||
log && log("after: quoted('\\n')");
|
||||
log && log(hex_view(ss.view().begin(), ss.view().end(), true));
|
||||
}
|
||||
|
||||
/* testing unexpected sstream behavior */
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
log && log("empty stream");
|
||||
|
||||
ss << quoted("foo\n");
|
||||
|
||||
log && log("after: quoted(\"foo\n\")");
|
||||
log && log(hex_view(ss.view().begin(), ss.view().end(), true));
|
||||
log && log("> ss.str ----------------");
|
||||
log && log(ss.str());
|
||||
log && log("< ss.str ----------------");
|
||||
}
|
||||
|
||||
/* testing unexpected sstream behavior */
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
log && log("empty stream");
|
||||
|
||||
ss << unq("\n");
|
||||
|
||||
log && log("after: unq('\\n')");
|
||||
log && log(hex_view(ss.view().begin(), ss.view().end(), true));
|
||||
}
|
||||
|
||||
} /*TEST_CASE(sstream)*/
|
||||
|
||||
|
||||
std::vector<quoted_tcase> s_quoted_tcase_v(
|
||||
{
|
||||
quoted_tcase("", true, "\"\""),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue