5418dfb19e
Summary: Rename redunant port str Add endpoint << operator Migrate everything to endpoint Reviewers: mferencevic, florijan Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1100
22 lines
478 B
C++
22 lines
478 B
C++
#include "gmock/gmock.h"
|
|
#include "gtest/gtest.h"
|
|
|
|
#include "utils/network.hpp"
|
|
|
|
using namespace utils;
|
|
|
|
TEST(ResolveHostname, Simple) {
|
|
auto result = ResolveHostname("localhost");
|
|
EXPECT_TRUE(result == "127.0.0.1" || result == "::1");
|
|
}
|
|
|
|
TEST(ResolveHostname, PassThroughIpv4) {
|
|
auto result = ResolveHostname("127.0.0.1");
|
|
EXPECT_EQ(result, "127.0.0.1");
|
|
}
|
|
|
|
TEST(ResolveHostname, PassThroughIpv6) {
|
|
auto result = ResolveHostname("::1");
|
|
EXPECT_EQ(result, "::1");
|
|
}
|