Ticket #10766: ticket_10766_fixtest.patch

File ticket_10766_fixtest.patch, 1.1 KB (added by Renu Tyagi <renu.tyagi@…>, 7 years ago)

As per my finding Boost considers parent path of /foo/ as /foo and not just /. This is shown in /libs/filesystem/path_test.cpp . But if still it is a bug, then here is the patch for bug and corresponding patch for path_test.cpp.

  • path_test.cpp

    a b namespace  
    932932
    933933    p = q = "/foo/";
    934934    PATH_TEST_EQ(p.relative_path().string(), "foo/");
    935     PATH_TEST_EQ(p.parent_path().string(), "/foo");
     935    PATH_TEST_EQ(p.parent_path().string(), "/");
    936936    PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
    937937    PATH_TEST_EQ(p.filename(), ".");
    938938    PATH_TEST_EQ(p.stem(), ".");
    namespace  
    10681068
    10691069    p = q = path("//net/");
    10701070    BOOST_TEST(p.relative_path().string() == "");
    1071     BOOST_TEST(p.parent_path().string() == "//net");
     1071    BOOST_TEST(p.parent_path().string() == "");
    10721072    PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
    10731073    BOOST_TEST(p.filename() == "/");
    10741074    BOOST_TEST(p.root_name() == "//net");
    namespace  
    10791079    BOOST_TEST(p.has_root_directory());
    10801080    BOOST_TEST(!p.has_relative_path());
    10811081    BOOST_TEST(p.has_filename());
    1082     BOOST_TEST(p.has_parent_path());
     1082    BOOST_TEST(!p.has_parent_path());
    10831083    BOOST_TEST(p.is_absolute());
    10841084
    10851085    p = q = path("//net/foo");