Skip to content

Commit

Permalink
Added a test case to test url string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed Mar 19, 2021
1 parent ca5f93b commit aac5058
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/structures_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "cpr/cprtypes.h"
#include <gtest/gtest.h>

#include <string>
Expand Down Expand Up @@ -49,6 +50,12 @@ TEST(ParametersTests, DisableEncodingTest) {
EXPECT_EQ(parameters.GetContent(CurlHolder()), expected);
}

TEST(UrlToAndFromString, UrlTests) {
std::string s{"https://github.com/whoshuu/cpr"};
cpr::Url url = s;
EXPECT_EQ(s, url.str());
}

int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
Expand Down

0 comments on commit aac5058

Please sign in to comment.