Skip to content

Commit fdfeeb8

Browse files
committed
Added test and applied fix for issue #67.
1 parent d4091d3 commit fdfeeb8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

boost/network/uri/uri.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ class uri
7272
return *this;
7373
}
7474

75-
uri &operator = (const string_type &uri_) {
76-
uri(uri_).swap(*this);
75+
uri &operator = (const string_type &uri) {
76+
uri_ = uri;
77+
parse();
7778
return *this;
7879
}
7980

libs/network/test/uri/url_test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,13 @@ BOOST_AUTO_TEST_CASE(range_test)
198198
BOOST_REQUIRE(uri::valid(instance));
199199
BOOST_CHECK(boost::equal(instance, url));
200200
}
201+
202+
BOOST_AUTO_TEST_CASE(issue_67_test)
203+
{
204+
const std::string site_name("http://www.google.com");
205+
uri::uri bar0;
206+
uri::uri bar1 = site_name;
207+
bar0 = site_name;
208+
BOOST_CHECK(uri::is_valid(bar0));
209+
BOOST_CHECK(uri::is_valid(bar1));
210+
}

0 commit comments

Comments
 (0)