feat update
This commit is contained in:
parent
ffdbf161b4
commit
a74d48b915
@ -26,6 +26,9 @@ public:
|
||||
// http://xxx.com/index.html
|
||||
static URI ParseURIReference(const std::string &uri_str);
|
||||
|
||||
URI() = default;
|
||||
URI(const std::string &uri_str);
|
||||
|
||||
// setter getter
|
||||
__SLED_URI_GETTER_AND_SETTER(std::string, scheme)
|
||||
__SLED_URI_GETTER_AND_SETTER(std::string, username)
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <sled/futures/promise.h>
|
||||
|
||||
TEST(Promise, Basic)
|
||||
{
|
||||
|
@ -13,4 +13,6 @@ URI::ParseURI(const std::string &uri_str)
|
||||
|
||||
return std::move(uri);
|
||||
}
|
||||
|
||||
URI::URI(const std::string &uri_str) { *this = ParseURI(uri_str); }
|
||||
}// namespace sled
|
||||
|
@ -1,2 +1,12 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <sled/uri.h>
|
||||
|
||||
TEST(URI, Absolute)
|
||||
{
|
||||
sled::URI uri("http://example.com");
|
||||
EXPECT_EQ(uri.scheme(), "http");
|
||||
EXPECT_EQ(uri.host(), "example.com");
|
||||
EXPECT_EQ(uri.path(), "/");
|
||||
EXPECT_TRUE(uri.query().empty());
|
||||
EXPECT_EQ(uri.anchor(), "");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user