summaryrefslogtreecommitdiff
path: root/test/tgbot/net
diff options
context:
space:
mode:
authorOleg Morozenkov <reo7sp@users.noreply.github.com>2017-01-15 02:01:22 +0300
committerOleg Morozenkov <reo7sp@users.noreply.github.com>2017-01-15 02:01:22 +0300
commitad676623168e7b7b083f66617087c6cf424000d1 (patch)
tree64a893a0c17e2a29c227ebdb53076e40ace19af0 /test/tgbot/net
parentbbf030e1d315d6ba108a75a5ce0113485a2319ba (diff)
Fix tests
Diffstat (limited to 'test/tgbot/net')
-rw-r--r--test/tgbot/net/HttpParser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/tgbot/net/HttpParser.cpp b/test/tgbot/net/HttpParser.cpp
index 236eb90..9272736 100644
--- a/test/tgbot/net/HttpParser.cpp
+++ b/test/tgbot/net/HttpParser.cpp
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(generateRequest) {
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Length: 49\r\n"
"\r\n"
- "email=test%40example.com&text=Hello%2c%20world%21";
+ "email=test%40example.com&text=Hello%2C%20world%21";
BOOST_CHECK_MESSAGE(t == e, diffS(t, e));
}
@@ -55,17 +55,18 @@ BOOST_AUTO_TEST_CASE(generateMultipartFormData) {
"\r\n"
"test@example.com\r\n"
"--" + boundary + "\r\n"
- "Content-Disposition: form-data; name=\"text\"\r\n"
+ "Content-Disposition: form-data; name=\"text\"; filename=\"\"\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
- "Hello, world!\r\n";
+ "Hello, world!\r\n"
+ "--" + boundary + "--\r\n";
BOOST_CHECK_MESSAGE(t == e, diffS(t, e));
}
BOOST_AUTO_TEST_CASE(generateWwwFormUrlencoded) {
vector<HttpReqArg> args = { HttpReqArg("email", "test@example.com"), HttpReqArg("text", "Hello, world!") };
string t = HttpParser::getInstance().generateWwwFormUrlencoded(args);
- string e = "email=test%40example.com&text=Hello%2c%20world%21";
+ string e = "email=test%40example.com&text=Hello%2C%20world%21";
BOOST_CHECK_MESSAGE(t == e, diffS(t, e));
}