sled/src/uri_test.cc
tqcq cf8ee4a243
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 1m40s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 49s
fix async redefined
2024-03-29 10:26:51 +08:00

15 lines
417 B
C++

#include <gtest/gtest.h>
#include <sled/uri.h>
TEST(URI, Absolute)
{
sled::URI uri("http://example.com:1234/dir1/dir2/file?a=1#anchor");
EXPECT_EQ(uri.scheme(), "http");
EXPECT_EQ(uri.host(), "example.com");
EXPECT_EQ(uri.port(), 1234);
EXPECT_EQ(uri.path(), "/dir1/dir2/file");
EXPECT_EQ(uri.query().size(), 1);
EXPECT_EQ(uri.query()["a"], "1");
EXPECT_EQ(uri.anchor(), "anchor");
}