mirror of https://github.com/aria2/aria2
Added test for JSON-RPC GET request without params parameter.
parent
bb9ad97c5c
commit
f999c2bcae
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue