Remove a not required whitespace when writing JSON in compact format
Task-number: QTBUG-36682 Change-Id: I0c1c0de850504c8dff20a5ae724cc868d9f983f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
62f01d581b
commit
6de515aea2
@ -195,7 +195,7 @@ static void objectContentToJson(const QJsonPrivate::Object *o, QByteArray &json,
|
||||
json += indentString;
|
||||
json += '"';
|
||||
json += escapedString(e->key());
|
||||
json += "\": ";
|
||||
json += compact ? "\":" : "\": ";
|
||||
valueToJson(o, e->value, json, indent, compact);
|
||||
|
||||
if (++i == o->length) {
|
||||
|
@ -1209,7 +1209,7 @@ void tst_QtJson::toJson()
|
||||
|
||||
QByteArray json = QJsonDocument(object).toJson(QJsonDocument::Compact);
|
||||
QByteArray expected =
|
||||
"{\"Array\": [true,999,\"string\",null,\"\\\\\\u0007\\n\\r\\b\\tabcABC\\\"\"],\"\\\\Key\\n\": \"Value\",\"null\": null}";
|
||||
"{\"Array\":[true,999,\"string\",null,\"\\\\\\u0007\\n\\r\\b\\tabcABC\\\"\"],\"\\\\Key\\n\":\"Value\",\"null\":null}";
|
||||
QCOMPARE(json, expected);
|
||||
|
||||
QJsonDocument doc;
|
||||
@ -2004,7 +2004,7 @@ void tst_QtJson::testDebugStream()
|
||||
qDebug() << object;
|
||||
|
||||
object.insert(QLatin1String("foo"), QLatin1String("bar"));
|
||||
QTest::ignoreMessage(QtDebugMsg, "QJsonObject({\"foo\": \"bar\"})");
|
||||
QTest::ignoreMessage(QtDebugMsg, "QJsonObject({\"foo\":\"bar\"})");
|
||||
qDebug() << object;
|
||||
}
|
||||
|
||||
@ -2031,7 +2031,7 @@ void tst_QtJson::testDebugStream()
|
||||
QJsonObject object;
|
||||
object.insert(QLatin1String("foo"), QLatin1String("bar"));
|
||||
doc.setObject(object);
|
||||
QTest::ignoreMessage(QtDebugMsg, "QJsonDocument({\"foo\": \"bar\"})");
|
||||
QTest::ignoreMessage(QtDebugMsg, "QJsonDocument({\"foo\":\"bar\"})");
|
||||
qDebug() << doc;
|
||||
|
||||
QJsonArray array;
|
||||
@ -2076,7 +2076,7 @@ void tst_QtJson::testDebugStream()
|
||||
QJsonObject object;
|
||||
object.insert(QLatin1String("foo"), QLatin1String("bar"));
|
||||
value = QJsonValue(object); // object
|
||||
QTest::ignoreMessage(QtDebugMsg, "QJsonValue(object, QJsonObject({\"foo\": \"bar\"}) )");
|
||||
QTest::ignoreMessage(QtDebugMsg, "QJsonValue(object, QJsonObject({\"foo\":\"bar\"}) )");
|
||||
qDebug() << value;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user