Skip to content
Snippets Groups Projects
Commit e8ba3e28 authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

added more uri parsing tests

parent 7661da5b
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,23 @@ static void test_query_parts() {
GPR_ASSERT(0 == strcmp("frag", uri->fragment));
grpc_uri_destroy(uri);
}
{
/* test the current behavior of multiple query part values */
const char *uri_text = "http://auth/path?foo=bar=baz&foobar==";
grpc_uri *uri = grpc_uri_parse(uri_text, 0);
GPR_ASSERT(uri);
GPR_ASSERT(0 == strcmp("http", uri->scheme));
GPR_ASSERT(0 == strcmp("auth", uri->authority));
GPR_ASSERT(0 == strcmp("/path", uri->path));
GPR_ASSERT(0 == strcmp("foo=bar=baz&foobar==", uri->query));
GPR_ASSERT(2 == uri->num_query_parts);
GPR_ASSERT(0 == strcmp("bar", grpc_uri_get_query_arg(uri, "foo")));
GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "foobar")));
grpc_uri_destroy(uri);
}
{
/* empty query */
const char *uri_text = "http://foo/path";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment