blob: de0599041a212d41ba6c59ae466fa211726af8e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/base/host_port_pair.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace {
TEST(HostPortPairTest, Parsing) {
HostPortPair foo("foo.com", 10);
std::string foo_str = foo.ToString();
EXPECT_EQ("foo.com:10", foo_str);
HostPortPair bar = HostPortPair::FromString(foo_str);
EXPECT_TRUE(foo.Equals(bar));
}
} // namespace
} // namespace net
|