This commit is contained in:
Sangeet 2026-09-04 11:06:03 +02:00 committed by GitHub
commit e5a95563de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -4648,7 +4648,7 @@ std::string JsonUnitTestResultPrinter::EscapeJson(const std::string& str) {
m << "\\r";
break;
default:
if (ch < ' ') {
if (static_cast<unsigned char>(ch) < ' ') {
m << "\\u00" << String::FormatByte(static_cast<unsigned char>(ch));
} else {
m << ch;

View File

@ -336,7 +336,7 @@ EXPECTED_NON_EMPTY = {
'time': '*',
'timestamp': '*',
'classname': 'PropertyRecordingTest',
'key_1': '1',
'key_1': 'caf\u00e9 \u4e2d',
},
{
'name': 'IntValuedProperty',
@ -878,7 +878,7 @@ class GTestJsonOutputUnitTest(gtest_test_utils.TestCase):
'the expected exit code %s.'
% (command, p.exit_code, expected_exit_code),
)
with open(json_path) as f:
with open(json_path, encoding='utf-8') as f:
actual = json.load(f)
return actual

View File

@ -144,7 +144,7 @@ It is good practice to tell why you skip a test.
</properties>
<testcase name="OneProperty" file="gtest_xml_output_unittest_.cc" line="125" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">
<properties>
<property name="key_1" value="1"/>
<property name="key_1" value="caf\u00e9 \u4e2d"/>
</properties>
</testcase>
<testcase name="IntValuedProperty" file="gtest_xml_output_unittest_.cc" line="129" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">

View File

@ -123,7 +123,7 @@ class PropertyRecordingTest : public Test {
};
TEST_F(PropertyRecordingTest, OneProperty) {
RecordProperty("key_1", "1");
RecordProperty("key_1", "caf\xC3\xA9 \xE4\xB8\xAD");
}
TEST_F(PropertyRecordingTest, IntValuedProperty) {