From 62956d17400760e233284aace491124978979a46 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 10 Oct 2023 07:41:26 -0700 Subject: [PATCH] fixup! fixup! Add iterator support to url_search_params and ada_c --- include/ada/url_search_params.h | 14 +++++++------- tests/url_search_params.cpp | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/ada/url_search_params.h b/include/ada/url_search_params.h index b7950d5df..0932ec076 100644 --- a/include/ada/url_search_params.h +++ b/include/ada/url_search_params.h @@ -95,18 +95,18 @@ struct url_search_params { inline std::string to_string(); /** - * Returns a simple JS-style iterator over all of the keys in this url_search_params. - * The keys in the iterator are not unique. The valid lifespan of the iterator - * is tied to the url_search_params. The iterator must be freed when you're - * done with it. + * Returns a simple JS-style iterator over all of the keys in this + * url_search_params. The keys in the iterator are not unique. The valid + * lifespan of the iterator is tied to the url_search_params. The iterator + * must be freed when you're done with it. * @see https://url.spec.whatwg.org/#interface-urlsearchparams */ inline url_search_params_keys_iter get_keys(); /** - * Returns a simple JS-style iterator over all of the values in this url_search_params. - * The valid lifespan of the iterator is tied to the url_search_params. The - * iterator must be freed when you're done with it. + * Returns a simple JS-style iterator over all of the values in this + * url_search_params. The valid lifespan of the iterator is tied to the + * url_search_params. The iterator must be freed when you're done with it. * @see https://url.spec.whatwg.org/#interface-urlsearchparams */ inline url_search_params_values_iter get_values(); diff --git a/tests/url_search_params.cpp b/tests/url_search_params.cpp index 07e831b70..558c242fd 100644 --- a/tests/url_search_params.cpp +++ b/tests/url_search_params.cpp @@ -203,11 +203,11 @@ TEST(url_search_params, iterators) { ASSERT_FALSE(entries.next().has_value()); // C++ conventional iterator - std::vector> expected = { - {"foo", "bar"}, - {"key2", "value3"}, - {"key1", "value2"}, - {"key1", "value1"}, + std::vector> expected = { + {"foo", "bar"}, + {"key2", "value3"}, + {"key1", "value2"}, + {"key1", "value1"}, }; for (auto& entry : search_params) { auto check = expected.back();