@@ -310,10 +310,42 @@ BOOST_AUTO_TEST_CASE(assignment_test) {
310310 BOOST_CHECK_EQUAL (instance, copy);
311311}
312312
313+ BOOST_AUTO_TEST_CASE (swap_test) {
314+ uri::uri instance (" http://www.example.com/" );
315+ uri::uri copy (" http://www.example.org/" );
316+ uri::swap (instance, copy);
317+ BOOST_CHECK_EQUAL (instance.string (), " http://www.example.org/" );
318+ BOOST_CHECK_EQUAL (copy.string (), " http://www.example.com/" );
319+ }
320+
321+ BOOST_AUTO_TEST_CASE (equality_test) {
322+ uri::uri uri_1 (" http://www.example.com/" );
323+ uri::uri uri_2 (" http://www.example.com/" );
324+ BOOST_CHECK (uri_1 == uri_2);
325+ }
326+
327+ BOOST_AUTO_TEST_CASE (inequality_test) {
328+ uri::uri uri_1 (" http://www.example.com/" );
329+ uri::uri uri_2 (" http://www.example.com/" );
330+ BOOST_CHECK (!(uri_1 != uri_2));
331+ }
332+
333+ BOOST_AUTO_TEST_CASE (less_than_test) {
334+ // uri_1 is lexicographically less than uri_2
335+ uri::uri uri_1 (" http://www.example.com/" );
336+ uri::uri uri_2 (" http://www.example.org/" );
337+ BOOST_CHECK (uri_1 < uri_2);
338+ }
339+
313340BOOST_AUTO_TEST_CASE (username_test) {
314- uri::uri instance (" ftp://john.doe:password @ftp.example.com/" );
341+ uri::uri
instance (
" ftp://[email protected] /" );
315342 BOOST_REQUIRE (uri::valid (instance));
316343 BOOST_CHECK_EQUAL (uri::username (instance), " john.doe" );
344+ }
345+
346+ BOOST_AUTO_TEST_CASE (pasword_test) {
347+ uri::uri
instance (
" ftp://john.doe:[email protected] /" );
348+ BOOST_REQUIRE (uri::valid (instance));
317349 BOOST_CHECK_EQUAL (uri::password (instance), " password" );
318350}
319351
0 commit comments