Skip to content

Commit 7219ad7

Browse files
committed
Update libs/network/test/uri/uri_test.cpp
1 parent 0dcea38 commit 7219ad7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

libs/network/test/uri/uri_test.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2009, 2010, 2011 Dean Michael Berris, Jeroen Habraken, Glyn Matthews.
1+
// Copyright 2009, 2010, 2011 Dean Michael Berris, Jeroen Habraken, Glyn Matthews, Fredrik Olofsson.
22
// Distributed under the Boost Software License, Version 1.0.
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
@@ -7,6 +7,7 @@
77
#include <boost/config/warning_disable.hpp>
88
#include <boost/test/unit_test.hpp>
99
#include <boost/network/uri.hpp>
10+
#include <boost/network/uri/utility.hpp>
1011
#include <boost/network/uri/uri.hpp>
1112
#include <boost/network/uri/uri_io.hpp>
1213
#include <boost/range/algorithm/equal.hpp>
@@ -463,3 +464,14 @@ BOOST_AUTO_TEST_CASE(issue_104_test) {
463464
instance.reset();
464465
BOOST_CHECK_EQUAL(uri::scheme(copy), "http");
465466
}
467+
468+
BOOST_AUTO_TEST_CASE(normalize_string) {
469+
BOOST_CHECK_EQUAL(uri::normalize(""), "/");
470+
BOOST_CHECK_EQUAL(uri::normalize("/"), "/");
471+
BOOST_CHECK_EQUAL(uri::normalize("/../"), "/");
472+
BOOST_CHECK_EQUAL(uri::normalize("/test/../../../"), "/");
473+
BOOST_CHECK_EQUAL(uri::normalize("../../test"), "/test");
474+
BOOST_CHECK_EQUAL(uri::normalize("/test/"), "/test");
475+
BOOST_CHECK_EQUAL(uri::normalize("/test/test/../"), "/test");
476+
BOOST_CHECK_EQUAL(uri::normalize("/../?test=test&param2=../p"), "/?test=test&param2=../p");
477+
}

0 commit comments

Comments
 (0)