Added test for JSON-RPC GET request without params parameter.

This commit is contained in:
Tatsuhiro Tsujikawa 2011-03-16 12:51:43 +09:00
parent bb9ad97c5c
commit f999c2bcae

View file

@ -472,6 +472,14 @@ void JsonTest::testDecodeGetParams()
CPPUNIT_ASSERT_EQUAL(std::string("[{}]"), gparam.request);
CPPUNIT_ASSERT_EQUAL(std::string("cb"), gparam.callback);
}
{
std::string query = "?method=sum&id=300";
json::JsonGetParam gparam = json::decodeGetParams(query);
CPPUNIT_ASSERT_EQUAL(std::string("{\"method\":\"sum\","
"\"id\":\"300\"}"),
gparam.request);
CPPUNIT_ASSERT_EQUAL(std::string(), gparam.callback);
}
}
} // namespace aria2