Skip to content
Snippets Groups Projects
Commit a8803e42 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

A few more tests

parent cb044633
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,8 @@ class A { ...@@ -16,6 +16,8 @@ class A {
mapping|string _headers; mapping|string _headers;
string _data; string _data;
int ok = 1;
this_program sync_request(string server, int port, string query, void|mapping|string headers, void|string data) { this_program sync_request(string server, int port, string query, void|mapping|string headers, void|string data) {
_server = server; _server = server;
...@@ -23,7 +25,6 @@ class A { ...@@ -23,7 +25,6 @@ class A {
_query = query; _query = query;
_headers = headers; _headers = headers;
_data = data; _data = data;
ok = 1;
return this; return this;
} }
...@@ -121,6 +122,32 @@ test_any_equal([[ ...@@ -121,6 +122,32 @@ test_any_equal([[
return h; return h;
]], (["host":"x","a":({"1","2"})])) ]], (["host":"x","a":({"1","2"})]))
test_any_equal([[
object o = H.do_method("GET","http://x/?a=b&c=d",0,0,CON());
return o->_query;
]], "GET /?a=b&c=d HTTP/1.0")
test_any_equal([[
object o = H.do_method("GET","http://x/?a=b&c=d",(["x":"y"]),0,CON());
return o->_query;
]], "GET /?a=b&c=d&x=y HTTP/1.0")
test_any_equal([[
object o = H.do_method("GET","http://x/",(["x":"y"]),0,CON());
return o->_query;
]], "GET /?x=y HTTP/1.0")
test_any_equal([[
object o = H.do_method("GET","http://x",0,0,CON());
return o->_query;
]], "GET / HTTP/1.0")
test_eval_error([[
CON c = CON();
c->ok = 0;
c->errno = 1;
object o = H.do_method("GET","http://x/",(["x":"y"]),0,c);
]])
dnl do_async_method dnl do_async_method
dnl do_async_proxied_method dnl do_async_proxied_method
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment