added more uri parsing tests

pull/6051/head
David Garcia Quintas 9 years ago
parent 7661da5b41
commit e8ba3e286d
  1. 17
      test/core/client_config/uri_parser_test.c

@ -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";

Loading…
Cancel
Save