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 .
2
2
// Distributed under the Boost Software License, Version 1.0.
3
3
// (See accompanying file LICENSE_1_0.txt of copy at
4
4
// http://www.boost.org/LICENSE_1_0.txt)
7
7
#include < boost/config/warning_disable.hpp>
8
8
#include < boost/test/unit_test.hpp>
9
9
#include < boost/network/uri.hpp>
10
+ #include < boost/network/uri/utility.hpp>
10
11
#include < boost/network/uri/uri.hpp>
11
12
#include < boost/network/uri/uri_io.hpp>
12
13
#include < boost/range/algorithm/equal.hpp>
@@ -463,3 +464,14 @@ BOOST_AUTO_TEST_CASE(issue_104_test) {
463
464
instance.reset ();
464
465
BOOST_CHECK_EQUAL (uri::scheme (copy), " http" );
465
466
}
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¶m2=../p" ), " /?test=test¶m2=../p" );
477
+ }
0 commit comments