mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add tests of get_lastpathsep
* This is an internal function but it's still useful to test it independently.
This commit is contained in:
@@ -255,6 +255,23 @@ TEST_CASE("String manipulation", "[string]")
|
||||
CHECK(strlower("FOOBAR") == "foobar");
|
||||
};
|
||||
|
||||
SECTION("get_lastpathsep")
|
||||
{
|
||||
CHECK(get_lastpathsep("") == -1);
|
||||
CHECK(get_lastpathsep("foo") == -1);
|
||||
CHECK(get_lastpathsep("foobar.blah") == -1);
|
||||
CHECK(get_lastpathsep("/foo") == 0);
|
||||
CHECK(get_lastpathsep("/foobar.blah") == 0);
|
||||
CHECK(get_lastpathsep("foo/bar/blah/") == 12);
|
||||
CHECK(get_lastpathsep("foo\\bar\\blah\\") == 12);
|
||||
CHECK(get_lastpathsep("foo/bar/blah") == 7);
|
||||
CHECK(get_lastpathsep("foo\\bar\\blah") == 7);
|
||||
CHECK(get_lastpathsep("/foo/bar/blah/") == 13);
|
||||
CHECK(get_lastpathsep("\\foo\\bar\\blah\\") == 13);
|
||||
CHECK(get_lastpathsep("/foo/bar/blah") == 8);
|
||||
CHECK(get_lastpathsep("\\foo\\bar\\blah") == 8);
|
||||
};
|
||||
|
||||
SECTION("basename")
|
||||
{
|
||||
CHECK(get_basename("") == "");
|
||||
|
||||
Reference in New Issue
Block a user