Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Arjo Chakravarty <[email protected]>
  • Loading branch information
arjo129 committed Feb 16, 2022
1 parent a388068 commit 79f476d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Filesystem_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,20 @@ TEST_F(FilesystemTest, exists)
EXPECT_FALSE(isDirectory(absoluteSubdir));
}

/////////////////////////////////////////////////
TEST_F(FilesystemTest, relative)
{
#ifndef _WIN32
std::string absPath {"/tmp/fstest"};
std::string relPath {"../fstest"};
#else
std::string absPath {"C:\\Users\\user\\Desktop\\test.txt"};
std::string relPath {"user\\Desktop\\test.txt"};
#endif
EXPECT_FALSE(isRelativePath(absPath));
EXPECT_TRUE(isRelativePath(relPath));
}

// The symlink tests require special permissions to work on Windows,
// so they will be disabled by default. For more information, see:
// https://github.com/ignitionrobotics/ign-common/issues/21
Expand Down

0 comments on commit 79f476d

Please sign in to comment.