-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEST] refactor UrlParser tests to use value-paramterized tests #3153
[TEST] refactor UrlParser tests to use value-paramterized tests #3153
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
|
||
#include "opentelemetry/ext/http/common/url_parser.h" | ||
|
||
namespace http_common = opentelemetry::ext::http::common; | ||
|
||
inline const char *BoolToString(bool b) | ||
struct ParsedUrl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used a dedicated structure instead of std::map<std::string, std::string>
because map's operator[]
may change the map (if a key does not exist, it will create a default-constructed value and put it into the map). Test data must be immutable.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3153 +/- ##
=======================================
Coverage 87.86% 87.86%
=======================================
Files 195 195
Lines 6151 6151
=======================================
Hits 5404 5404
Misses 747 747
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
Waiting a bit for possible comments, then will merge. |
As discussed in #3146
Changes
This PR refactors the UrlParser tests to make them more readable and use value-parametrized tests.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes