Fix colors in output of TestSamples (#3332)
This commit is contained in:
parent
009c144455
commit
afac0e8ad3
|
@ -101,6 +101,11 @@ private:
|
|||
setSettings(set);
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
virtual void reportOut(const std::string &outmsg, Color = Color::Reset) override {
|
||||
std::cout << outmsg << std::endl;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
void runConsoleCodePageTranslationOnWindows() const {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "redirect.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cctype>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
|
@ -124,8 +125,10 @@ static std::string writestr(const std::string &str, bool gccStyle = false)
|
|||
ostr << "\\t";
|
||||
else if (*i == '\"')
|
||||
ostr << "\\\"";
|
||||
else
|
||||
else if (std::isprint(static_cast<unsigned char>(*i)))
|
||||
ostr << *i;
|
||||
else
|
||||
ostr << "\\x" << std::hex << short{*i};
|
||||
}
|
||||
if (!str.empty() && !gccStyle)
|
||||
ostr << std::endl;
|
||||
|
|
Loading…
Reference in New Issue