uri_parser_test.cc
Go to the documentation of this file.
1 //
2 // Copyright 2015 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
18 
19 #include <utility>
20 
21 #include "absl/status/status.h"
22 #include "gmock/gmock.h"
23 #include "gtest/gtest.h"
24 
25 #include <grpc/grpc.h>
26 
28 
33 
34 namespace grpc_core {
35 
36 class URIParserTest : public testing::Test {
37  protected:
38  static void TestSucceeds(
39  absl::string_view uri_text, absl::string_view scheme,
41  const std::map<absl::string_view, absl::string_view>& query_param_map,
42  const std::vector<URI::QueryParam>& query_param_pairs,
43  absl::string_view fragment) {
44  absl::StatusOr<URI> uri = URI::Parse(uri_text);
45  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
46  EXPECT_EQ(scheme, uri->scheme());
47  EXPECT_EQ(authority, uri->authority());
48  EXPECT_EQ(path, uri->path());
49  EXPECT_THAT(uri->query_parameter_map(), ContainerEq(query_param_map));
50  EXPECT_THAT(uri->query_parameter_pairs(), ContainerEq(query_param_pairs));
51  EXPECT_EQ(fragment, uri->fragment());
52  }
53 
54  static void TestFails(absl::string_view uri_text) {
55  absl::StatusOr<URI> uri = URI::Parse(uri_text);
56  ASSERT_FALSE(uri.ok());
57  }
58 };
59 
60 TEST_F(URIParserTest, BasicExamplesAreParsedCorrectly) {
61  TestSucceeds("http://www.google.com", "http", "www.google.com", "", {}, {},
62  "");
63  TestSucceeds("dns:///foo", "dns", "", "/foo", {}, {}, "");
64  TestSucceeds("http://www.google.com:90", "http", "www.google.com:90", "", {},
65  {}, "");
66  TestSucceeds("a192.4-df:foo.coom", "a192.4-df", "", "foo.coom", {}, {}, "");
67  TestSucceeds("a+b:foo.coom", "a+b", "", "foo.coom", {}, {}, "");
68  TestSucceeds("zookeeper://127.0.0.1:2181/foo/bar", "zookeeper",
69  "127.0.0.1:2181", "/foo/bar", {}, {}, "");
70  TestSucceeds("dns:foo.com#fragment-all-the-things", "dns", "", "foo.com", {},
71  {}, "fragment-all-the-things");
72  TestSucceeds("http://localhost:8080/whatzit?mi_casa=su_casa", "http",
73  "localhost:8080", "/whatzit", {{"mi_casa", "su_casa"}},
74  {{"mi_casa", "su_casa"}}, "");
75  TestSucceeds("http://localhost:8080/whatzit?1=2#buckle/my/shoe", "http",
76  "localhost:8080", "/whatzit", {{"1", "2"}}, {{"1", "2"}},
77  "buckle/my/shoe");
78 }
79 
80 TEST_F(URIParserTest, UncommonValidExamplesAreParsedCorrectly) {
81  TestSucceeds("scheme:path//is/ok", "scheme", "", "path//is/ok", {}, {}, "");
82  TestSucceeds("http:?legit", "http", "", "", {{"legit", ""}}, {{"legit", ""}},
83  "");
84  TestSucceeds("unix:#this-is-ok-too", "unix", "", "", {}, {},
85  "this-is-ok-too");
86  TestSucceeds("http:?legit#twice", "http", "", "", {{"legit", ""}},
87  {{"legit", ""}}, "twice");
88  TestSucceeds("fake:///", "fake", "", "/", {}, {}, "");
89  TestSucceeds("http://local%25host:8080/whatz%25it?1%25=2%25#fragment", "http",
90  "local%host:8080", "/whatz%it", {{"1%", "2%"}}, {{"1%", "2%"}},
91  "fragment");
92 }
93 
94 TEST_F(URIParserTest, VariousKeyValueAndNonKVQueryParamsAreParsedCorrectly) {
95  TestSucceeds("http://foo/path?a&b=B&c=&#frag", "http", "foo", "/path",
96  {{"c", ""}, {"a", ""}, {"b", "B"}},
97  {{"a", ""}, {"b", "B"}, {"c", ""}}, "frag");
98 }
99 
100 TEST_F(URIParserTest, ParserTreatsFirstEqualSignAsKVDelimiterInQueryString) {
101  TestSucceeds(
102  "http://localhost:8080/?too=many=equals&are=present=here#fragged", "http",
103  "localhost:8080", "/", {{"are", "present=here"}, {"too", "many=equals"}},
104  {{"too", "many=equals"}, {"are", "present=here"}}, "fragged");
105  TestSucceeds("http://auth/path?foo=bar=baz&foobar===", "http", "auth",
106  "/path", {{"foo", "bar=baz"}, {"foobar", "=="}},
107  {{"foo", "bar=baz"}, {"foobar", "=="}}, "");
108 }
109 
111  RepeatedQueryParamsAreSupportedInOrderedPairsButDeduplicatedInTheMap) {
112  absl::StatusOr<URI> uri = URI::Parse("http://foo/path?a=2&a=1&a=3");
113  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
114  // The map stores the last found value.
115  ASSERT_THAT(uri->query_parameter_map(), ElementsAre(Pair("a", "3")));
116  // Order matters for query parameter pairs
118  ElementsAre(URI::QueryParam{"a", "2"}, URI::QueryParam{"a", "1"},
119  URI::QueryParam{"a", "3"}));
120 }
121 
122 TEST_F(URIParserTest, QueryParamMapRemainsValiditAfterMovingTheURI) {
123  URI uri_copy;
124  {
125  absl::StatusOr<URI> uri = URI::Parse("http://foo/path?a=2&b=1&c=3");
126  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
127  uri_copy = std::move(*uri);
128  }
129  // ASSERT_EQ(uri_copy.query_parameter_map().find("a")->second, "2");
130  ASSERT_THAT(uri_copy.query_parameter_map(), Contains(Pair("a", "2")));
131 }
132 
133 TEST_F(URIParserTest, QueryParamMapRemainsValidAfterCopyingTheURI) {
134  // Since the query parameter map points to objects stored in the param pair
135  // vector, this test checks that the param map pointers remain valid after
136  // a copy. Ideally {a,m}san will catch this if there's a problem.
137  // testing copy operator=:
138  URI uri_copy;
139  {
140  absl::StatusOr<URI> del_uri = URI::Parse("http://foo/path?a=2&b=1&c=3");
141  ASSERT_TRUE(del_uri.ok()) << del_uri.status().ToString();
142  uri_copy = *del_uri;
143  }
144  ASSERT_THAT(uri_copy.query_parameter_map(), Contains(Pair("a", "2")));
145  URI* del_uri2 = new URI(uri_copy);
146  URI uri_copy2(*del_uri2);
147  delete del_uri2;
148  ASSERT_THAT(uri_copy2.query_parameter_map(), Contains(Pair("a", "2")));
149 }
150 
151 TEST_F(URIParserTest, AWSExternalAccountRegressionTest) {
152  TestSucceeds(
153  "https://foo.com:5555/v1/"
154  "token-exchange?subject_token=eyJhbGciO&subject_token_type=urn:ietf:"
155  "params:oauth:token-type:id_token",
156  "https", "foo.com:5555", "/v1/token-exchange",
157  {{"subject_token", "eyJhbGciO"},
158  {"subject_token_type", "urn:ietf:params:oauth:token-type:id_token"}},
159  {{"subject_token", "eyJhbGciO"},
160  {"subject_token_type", "urn:ietf:params:oauth:token-type:id_token"}},
161  "");
162 }
163 
164 TEST_F(URIParserTest, NonKeyValueQueryStringsWork) {
165  TestSucceeds("http://www.google.com?yay-i'm-using-queries", "http",
166  "www.google.com", "", {{"yay-i'm-using-queries", ""}},
167  {{"yay-i'm-using-queries", ""}}, "");
168 }
169 
170 TEST_F(URIParserTest, IPV6StringsAreParsedCorrectly) {
171  TestSucceeds("ipv6:[2001:db8::1%252]:12345", "ipv6", "",
172  "[2001:db8::1%2]:12345", {}, {}, "");
173  TestSucceeds("ipv6:[fe80::90%eth1.sky1]:6010", "ipv6", "",
174  "[fe80::90%eth1.sky1]:6010", {}, {}, "");
175 }
176 
178  PreviouslyReservedCharactersInUnrelatedURIPartsAreIgnored) {
179  // The '?' and '/' characters are not reserved delimiter characters in the
180  // fragment. See http://go/rfc/3986#section-3.5
181  TestSucceeds("http://foo?bar#lol?", "http", "foo", "", {{"bar", ""}},
182  {{"bar", ""}}, "lol?");
183  TestSucceeds("http://foo?bar#lol?/", "http", "foo", "", {{"bar", ""}},
184  {{"bar", ""}}, "lol?/");
185 }
186 
187 TEST_F(URIParserTest, EncodedCharactersInQueryStringAreParsedCorrectly) {
188  TestSucceeds("https://www.google.com/?a=1%26b%3D2&c=3", "https",
189  "www.google.com", "/", {{"c", "3"}, {"a", "1&b=2"}},
190  {{"a", "1&b=2"}, {"c", "3"}}, "");
191 }
192 
193 TEST_F(URIParserTest, InvalidPercentEncodingsArePassedThrough) {
194  TestSucceeds("x:y?%xx", "x", "", "y", {{"%xx", ""}}, {{"%xx", ""}}, "");
195  TestSucceeds("http:?dangling-pct-%0", "http", "", "",
196  {{"dangling-pct-%0", ""}}, {{"dangling-pct-%0", ""}}, "");
197 }
198 
199 TEST_F(URIParserTest, NullCharactersInURIStringAreSupported) {
200  // Artificial examples to show that embedded nulls are supported.
201  TestSucceeds(std::string("unix-abstract:\0should-be-ok", 27), "unix-abstract",
202  "", std::string("\0should-be-ok", 13), {}, {}, "");
203 }
204 
205 TEST_F(URIParserTest, EncodedNullsInURIStringAreSupported) {
206  TestSucceeds("unix-abstract:%00x", "unix-abstract", "", std::string("\0x", 2),
207  {}, {}, "");
208 }
209 
210 TEST_F(URIParserTest, InvalidURIsResultInFailureStatuses) {
211  TestFails("xyz");
212  TestFails("http://foo?[bar]");
213  TestFails("http://foo?x[bar]");
214  TestFails("http://foo?bar#lol#");
215  TestFails("");
216  TestFails(":no_scheme");
217  TestFails("0invalid_scheme:must_start/with?alpha");
218 }
219 
220 TEST(URITest, PercentEncodePath) {
222  // These chars are allowed.
223  "abcdefghijklmnopqrstuvwxyz"
224  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
225  "0123456789"
226  "/:@-._~!$&'()*+,;="
227  // These chars will be escaped.
228  "\\?%#[]^"),
229  "abcdefghijklmnopqrstuvwxyz"
230  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
231  "0123456789"
232  "/:@-._~!$&'()*+,;="
233  "%5C%3F%25%23%5B%5D%5E");
234 }
235 
236 TEST(URITest, Basic) {
237  auto uri =
238  URI::Create("http", "server.example.com", "/path/to/file.html", {}, "");
239  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
240  EXPECT_EQ(uri->scheme(), "http");
241  EXPECT_EQ(uri->authority(), "server.example.com");
242  EXPECT_EQ(uri->path(), "/path/to/file.html");
243  EXPECT_THAT(uri->query_parameter_pairs(), testing::ElementsAre());
244  EXPECT_THAT(uri->query_parameter_map(), testing::ElementsAre());
245  EXPECT_EQ(uri->fragment(), "");
246  EXPECT_EQ("http://server.example.com/path/to/file.html", uri->ToString());
247 }
248 
249 TEST(URITest, NoAuthority) {
250  auto uri = URI::Create("http", "", "/path/to/file.html", {}, "");
251  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
252  EXPECT_EQ(uri->scheme(), "http");
253  EXPECT_EQ(uri->authority(), "");
254  EXPECT_EQ(uri->path(), "/path/to/file.html");
255  EXPECT_THAT(uri->query_parameter_pairs(), testing::ElementsAre());
256  EXPECT_THAT(uri->query_parameter_map(), testing::ElementsAre());
257  EXPECT_EQ(uri->fragment(), "");
258  EXPECT_EQ("http:/path/to/file.html", uri->ToString());
259 }
260 
261 TEST(URITest, NoAuthorityRelativePath) {
262  auto uri = URI::Create("http", "", "path/to/file.html", {}, "");
263  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
264  EXPECT_EQ(uri->scheme(), "http");
265  EXPECT_EQ(uri->authority(), "");
266  EXPECT_EQ(uri->path(), "path/to/file.html");
267  EXPECT_THAT(uri->query_parameter_pairs(), testing::ElementsAre());
268  EXPECT_THAT(uri->query_parameter_map(), testing::ElementsAre());
269  EXPECT_EQ(uri->fragment(), "");
270  EXPECT_EQ("http:path/to/file.html", uri->ToString());
271 }
272 
273 TEST(URITest, AuthorityRelativePath) {
274  auto uri =
275  URI::Create("http", "server.example.com", "path/to/file.html", {}, "");
276  ASSERT_FALSE(uri.ok());
277  EXPECT_EQ(uri.status().code(), absl::StatusCode::kInvalidArgument);
278  EXPECT_EQ(uri.status().message(),
279  "if authority is present, path must start with a '/'");
280 }
281 
282 TEST(URITest, QueryParams) {
283  auto uri = URI::Create("http", "server.example.com", "/path/to/file.html",
284  {{"key", "value"}, {"key2", "value2"}}, "");
285  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
286  EXPECT_EQ(uri->scheme(), "http");
287  EXPECT_EQ(uri->authority(), "server.example.com");
288  EXPECT_EQ(uri->path(), "/path/to/file.html");
289  EXPECT_THAT(
290  uri->query_parameter_pairs(),
295  testing::Field(&URI::QueryParam::value, "value2"))));
296  EXPECT_THAT(uri->query_parameter_map(),
297  testing::ElementsAre(testing::Pair("key", "value"),
298  testing::Pair("key2", "value2")));
299  EXPECT_EQ(uri->fragment(), "");
300  EXPECT_EQ("http://server.example.com/path/to/file.html?key=value&key2=value2",
301  uri->ToString());
302 }
303 
304 TEST(URITest, DuplicateQueryParams) {
305  auto uri = URI::Create(
306  "http", "server.example.com", "/path/to/file.html",
307  {{"key", "value"}, {"key2", "value2"}, {"key", "other_value"}}, "");
308  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
309  EXPECT_EQ(uri->scheme(), "http");
310  EXPECT_EQ(uri->authority(), "server.example.com");
311  EXPECT_EQ(uri->path(), "/path/to/file.html");
312  EXPECT_THAT(
313  uri->query_parameter_pairs(),
321  testing::Field(&URI::QueryParam::value, "other_value"))));
322  EXPECT_THAT(uri->query_parameter_map(),
323  testing::ElementsAre(testing::Pair("key", "other_value"),
324  testing::Pair("key2", "value2")));
325  EXPECT_EQ(uri->fragment(), "");
326  EXPECT_EQ(
327  "http://server.example.com/path/to/file.html"
328  "?key=value&key2=value2&key=other_value",
329  uri->ToString());
330 }
331 
332 TEST(URITest, Fragment) {
333  auto uri = URI::Create("http", "server.example.com", "/path/to/file.html", {},
334  "fragment");
335  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
336  EXPECT_EQ(uri->scheme(), "http");
337  EXPECT_EQ(uri->authority(), "server.example.com");
338  EXPECT_EQ(uri->path(), "/path/to/file.html");
339  EXPECT_THAT(uri->query_parameter_pairs(), testing::ElementsAre());
340  EXPECT_THAT(uri->query_parameter_map(), testing::ElementsAre());
341  EXPECT_EQ(uri->fragment(), "fragment");
342  EXPECT_EQ("http://server.example.com/path/to/file.html#fragment",
343  uri->ToString());
344 }
345 
346 TEST(URITest, QueryParamsAndFragment) {
347  auto uri = URI::Create("http", "server.example.com", "/path/to/file.html",
348  {{"key", "value"}, {"key2", "value2"}}, "fragment");
349  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
350  EXPECT_EQ(uri->scheme(), "http");
351  EXPECT_EQ(uri->authority(), "server.example.com");
352  EXPECT_EQ(uri->path(), "/path/to/file.html");
353  EXPECT_THAT(
354  uri->query_parameter_pairs(),
359  testing::Field(&URI::QueryParam::value, "value2"))));
360  EXPECT_THAT(uri->query_parameter_map(),
361  testing::ElementsAre(testing::Pair("key", "value"),
362  testing::Pair("key2", "value2")));
363  EXPECT_EQ(uri->fragment(), "fragment");
364  EXPECT_EQ(
365  "http://server.example.com/path/to/"
366  "file.html?key=value&key2=value2#fragment",
367  uri->ToString());
368 }
369 
370 TEST(URITest, ToStringPercentEncoding) {
371  auto uri = URI::Create(
372  // Scheme allowed chars.
373  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-."
374  // Scheme escaped chars.
375  "%:/?#[]@!$&'()*,;=",
376  // Authority allowed chars.
377  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
378  "-.+~!$&'()*+,;=:[]@"
379  // Authority escaped chars.
380  "%/?#",
381  // Path allowed chars.
382  "/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
383  "-._~!$&'()*+,;=:@"
384  // Path escaped chars.
385  "%?#[]",
386  {{// Query allowed chars.
387  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
388  "-._~!$'()*+,;:@/?"
389  // Query escaped chars.
390  "%=&#[]",
391  // Query allowed chars.
392  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
393  "-._~!$'()*+,;:@/?"
394  // Query escaped chars.
395  "%=&#[]"}},
396  // Fragment allowed chars.
397  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
398  "-._~!$'()*+,;:@/?=&"
399  // Fragment escaped chars.
400  "%#[]");
401  ASSERT_TRUE(uri.ok()) << uri.status().ToString();
402  EXPECT_EQ(uri->scheme(),
403  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-."
404  "%:/?#[]@!$&'()*,;=");
405  EXPECT_EQ(uri->authority(),
406  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
407  "-.+~!$&'()*+,;=:[]@"
408  "%/?#");
409  EXPECT_EQ(uri->path(),
410  "/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
411  "-._~!$&'()*+,;=:@"
412  "%?#[]");
413  EXPECT_THAT(
414  uri->query_parameter_pairs(),
418  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
419  "-._~!$'()*+,;:@/?"
420  "%=&#[]"),
423  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
424  "-._~!$'()*+,;:@/?"
425  "%=&#[]"))));
426  EXPECT_THAT(
427  uri->query_parameter_map(),
429  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
430  "-._~!$'()*+,;:@/?"
431  "%=&#[]",
432  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
433  "-._~!$'()*+,;:@/?"
434  "%=&#[]")));
435  EXPECT_EQ(uri->fragment(),
436  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
437  "-._~!$'()*+,;:@/?=&"
438  "%#[]");
439  EXPECT_EQ(
440  // Scheme
441  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-."
442  "%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2C%3B%3D"
443  // Authority
444  "://abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
445  "-.+~!$&'()*+,;=:[]@"
446  "%25%2F%3F%23"
447  // Path
448  "/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
449  "-._~!$&'()*+,;=:@"
450  "%25%3F%23%5B%5D"
451  // Query
452  "?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
453  "-._~!$'()*+,;:@/?"
454  "%25%3D%26%23%5B%5D"
455  "=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
456  "-._~!$'()*+,;:@/?"
457  "%25%3D%26%23%5B%5D"
458  // Fragment
459  "#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
460  "-._~!$'()*+,;:@/?=&"
461  "%25%23%5B%5D",
462  uri->ToString());
463 }
464 
465 } // namespace grpc_core
466 
467 int main(int argc, char** argv) {
468  testing::InitGoogleTest(&argc, argv);
469  grpc::testing::TestEnvironment env(&argc, argv);
470  grpc_init();
471  auto result = RUN_ALL_TESTS();
472  grpc_shutdown();
473  return result;
474 }
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
grpc_core::URIParserTest::TestFails
static void TestFails(absl::string_view uri_text)
Definition: uri_parser_test.cc:54
generate.env
env
Definition: generate.py:37
EXPECT_THAT
#define EXPECT_THAT(value, matcher)
grpc_core::URI::QueryParam::key
std::string key
Definition: uri_parser.h:34
grpc_core
Definition: call_metric_recorder.h:31
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_core::URI
Definition: uri_parser.h:31
grpc_core::TEST
TEST(AvlTest, NoOp)
Definition: avl_test.cc:21
check_documentation.path
path
Definition: check_documentation.py:57
grpc_core::URI::Parse
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
Definition: uri_parser.cc:209
grpc_core::URI::QueryParam::value
std::string value
Definition: uri_parser.h:35
testing::Test
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:402
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: iomgr/time_averaged_stats_test.cc:27
testing::ElementsAre
internal::ElementsAreMatcher< ::testing::tuple<> > ElementsAre()
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:13040
grpc_core::URI::QueryParam
Definition: uri_parser.h:33
grpc_core::URIParserTest::TestSucceeds
static void TestSucceeds(absl::string_view uri_text, absl::string_view scheme, absl::string_view authority, absl::string_view path, const std::map< absl::string_view, absl::string_view > &query_param_map, const std::vector< URI::QueryParam > &query_param_pairs, absl::string_view fragment)
Definition: uri_parser_test.cc:38
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
ASSERT_THAT
#define ASSERT_THAT(value, matcher)
grpc.h
grpc_core::TEST_F
TEST_F(AuthorizationMatchersTest, AlwaysAuthorizationMatcher)
Definition: authorization_matchers_test.cc:35
grpc_core::URI::query_parameter_pairs
const std::vector< QueryParam > & query_parameter_pairs() const
Definition: uri_parser.h:81
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
testing::Pair
internal::PairMatcher< FirstMatcher, SecondMatcher > Pair(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:9152
absl::StatusCode::kInvalidArgument
@ kInvalidArgument
test_config.h
absl::container_internal::internal_layout::Contains
absl::disjunction< std::is_same< T, Ts >... > Contains
Definition: abseil-cpp/absl/container/internal/layout.h:253
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
grpc_core::URI::PercentEncodePath
static std::string PercentEncodePath(absl::string_view str)
Definition: uri_parser.cc:181
grpc_core::URI::Create
static absl::StatusOr< URI > Create(std::string scheme, std::string authority, std::string path, std::vector< QueryParam > query_parameter_pairs, std::string fragment)
Definition: uri_parser.cc:289
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
ASSERT_TRUE
#define ASSERT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1973
ASSERT_FALSE
#define ASSERT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1976
testing::Field
testing::AllOf
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:13472
main
int main(int argc, char **argv)
Definition: uri_parser_test.cc:467
testing::ContainerEq
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8969
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
uri_parser.h
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
grpc_core::URI::query_parameter_map
const std::map< absl::string_view, absl::string_view > & query_parameter_map() const
Definition: uri_parser.h:74
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_core::URIParserTest
Definition: uri_parser_test.cc:36
absl::StatusOr::status
const Status & status() const &
Definition: abseil-cpp/absl/status/statusor.h:678


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:48