From 31f92915ef254bbdb702e1de0de72bdeff831ab6 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Fri, 20 Aug 2010 12:59:07 +0000 Subject: implement and test quoted character handling --- tests/tests.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/tests.cpp') diff --git a/tests/tests.cpp b/tests/tests.cpp index 981c3abf..91cf510e 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -56,12 +56,13 @@ void TestUtils::testDigestMd5() QCOMPARE(serializeDigestMd5(empty), QByteArray()); // non-empty - const QByteArray bytes("number=12345,quoted=\"quoted string\",string=string"); + const QByteArray bytes("number=12345,quoted_plain=\"quoted string\",quoted_quote=\"quoted\\\\slash\\\"quote\",string=string"); QMap map = parseDigestMd5(bytes); - QCOMPARE(map.size(), 3); + QCOMPARE(map.size(), 4); QCOMPARE(map["number"], QByteArray("12345")); - QCOMPARE(map["quoted"], QByteArray("quoted string")); + QCOMPARE(map["quoted_plain"], QByteArray("quoted string")); + QCOMPARE(map["quoted_quote"], QByteArray("quoted\\slash\"quote")); QCOMPARE(map["string"], QByteArray("string")); QCOMPARE(serializeDigestMd5(map), bytes); } -- cgit v1.2.3