diff options
author | 2016-04-01 11:21:32 -0700 | |
---|---|---|
committer | 2016-04-01 11:21:32 -0700 | |
commit | 00eef19acd8a6c3a8ae41929571c4cc040f73132 (patch) | |
tree | 12e72e5782f35a400d629a618a95bd29790a4976 /test | |
parent | 25058c965ef18908ef9bd7fe3cfcf932b4328a28 (diff) | |
parent | e8ba3e286dc18d0b14a1e1febc65d52a9b37959f (diff) |
Merge pull request #6051 from dgquintas/moar_uri_tests
added more uri parsing tests
Diffstat (limited to 'test')
-rw-r--r-- | test/core/client_config/uri_parser_test.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/core/client_config/uri_parser_test.c b/test/core/client_config/uri_parser_test.c index 37b82aeded..f87aa81ee6 100644 --- a/test/core/client_config/uri_parser_test.c +++ b/test/core/client_config/uri_parser_test.c @@ -89,6 +89,23 @@ static void test_query_parts() { 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"; grpc_uri *uri = grpc_uri_parse(uri_text, 0); |