[Boost-bugs] [Boost C++ Libraries] #5317: Path filename(), stem(), and extension() problems

Subject: [Boost-bugs] [Boost C++ Libraries] #5317: Path filename(), stem(), and extension() problems
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-16 12:42:50


#5317: Path filename(), stem(), and extension() problems
------------------------------+---------------------------------------------
 Reporter: bemandawes | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.46.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 Problem: filename() is specified in terms of *--end(), but path_test.cpp
 does not actually test this. Since the actual implementation of filename()
 does not use iteration, such a test should be performed.

 Resolution: Add something like BOOST_TEST_EQ(p.filename(), *--p.end()); to
 the decomposition tests.

 Problem: stem() + extension() should == filename(), but path_test.cpp does
 not actually test this.

 Resolution: Add something like BOOST_TEST_EQ(p.filename(),
 path(p.stem().native() + p.extension().native()));); to the decomposition
 tests.

 Problem: path(".foo") should be a stem, not an extension.

 Resolution: Fix specification, implementation, and add test cases.

 Problem: Design of Path iterator, and as a consequence, filename(), is too
 inventive in adding "." KISS. Note that POSIX has similar problems. POSIX
 dirname() and basename() are not good models; they (1) modify their
 arguments, and (2) return counter-intuitive results. basename("/foo/")
 returns "foo", not "" or "."

 Resolution: Simplify specification, change implementation and test cases
 accordingly.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5317>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC