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

pull/1/head
Tatsuhiro Tsujikawa 2011-03-16 12:51:43 +09:00
parent bb9ad97c5c
commit f999c2bcae
1 changed files with 8 additions and 0 deletions

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