diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-30 11:47:55 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-30 11:47:55 +0100 |
commit | be5b25b18a56c690a71d7241dfc680c0b5375e1b (patch) | |
tree | 2e58bb1fe3dc395bc4247b8ecc4becf09b346e2f /test | |
parent | 33628e1f35ab1eb593391e87faaf9115b203c9b3 (diff) |
added a unit test for absolute paths.
Diffstat (limited to 'test')
-rw-r--r-- | test/plugins/filesystem/FileLocatorTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/plugins/filesystem/FileLocatorTest.cpp b/test/plugins/filesystem/FileLocatorTest.cpp index 75d9f33..87a9223 100644 --- a/test/plugins/filesystem/FileLocatorTest.cpp +++ b/test/plugins/filesystem/FileLocatorTest.cpp @@ -142,6 +142,17 @@ TEST(FileLocator, locate) assert_not_located(locator, "c.txt", "", ResourceType::SCRIPT); } +TEST(FileLocator, locateAbsolute){ + FileLocator locator; + // construct the absolute path by utilizing SpecialPaths and + fs::path testdataDir {SpecialPaths::getDebugTestdataDir()}; + fs::path absolute = fs::canonical(testdataDir); + absolute /= "filesystem"; + absolute /= "a.txt"; + Resource resA; + ASSERT_TRUE(locator.locate(resA, absolute.string())); +} + TEST(FileLocator, locateRelative) { FileLocator locator; |