diff options
author | Johannes Schickel | 2010-08-16 16:01:31 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-08-16 16:01:31 +0000 |
commit | 7b51537be2341b62795c308c140faca387fa04e6 (patch) | |
tree | 76ad8edab7ba719037f47dc113f6fdbcadaca858 /test/common/str.h | |
parent | c284e78cc0bbb0e861162c4c4cc8c765ec60d5f1 (diff) | |
download | scummvm-rg350-7b51537be2341b62795c308c140faca387fa04e6.tar.gz scummvm-rg350-7b51537be2341b62795c308c140faca387fa04e6.tar.bz2 scummvm-rg350-7b51537be2341b62795c308c140faca387fa04e6.zip |
Common: Fix bug in lastPathComponent.
Prior to this change lastPathComponent would not create a correct result,
when the input of lastPathComponent did not contain a single separator.
I also added a test case for this in our unit tests.
svn-id: r52123
Diffstat (limited to 'test/common/str.h')
-rw-r--r-- | test/common/str.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/common/str.h b/test/common/str.h index 6581c37cdb..e1f2b39578 100644 --- a/test/common/str.h +++ b/test/common/str.h @@ -266,6 +266,8 @@ class StringTestSuite : public CxxTest::TestSuite TS_ASSERT_EQUALS(Common::lastPathComponent("foo/./bar", '/'), "bar"); TS_ASSERT_EQUALS(Common::lastPathComponent("foo//./bar//", '/'), "bar"); TS_ASSERT_EQUALS(Common::lastPathComponent("foo//.bar//", '/'), ".bar"); + + TS_ASSERT_EQUALS(Common::lastPathComponent("foo", '/'), "foo"); } void test_normalizePath() { |