[JENKINS-13649] Adding a test case

This commit is contained in:
Stephen Connolly committed 2012-05-01 09:39:05 +01:00
1 parent 708b609ccc
commit 71debc2b89
1 file changed
+13
@@ -379,4 +379,17 @@ public class FilePathTest extends ChannelTestCase {
tmp.deleteRecursive();
}
}
@Bug(13649)
public void testMultiSegmentRelativePaths() throws Exception {
FilePath winPath = new FilePath(new LocalChannel(null), "c:\\app\\jenkins\\workspace");
FilePath nixPath = new FilePath(new LocalChannel(null), "/opt/jenkins/workspace");
assertEquals("c:\\app\\jenkins\\workspace\\foo\\bar\\manchu", new FilePath(winPath, "foo/bar/manchu").getRemote());
assertEquals("c:\\app\\jenkins\\workspace\\foo\\bar\\manchu", new FilePath(winPath, "foo\\bar/manchu").getRemote());
assertEquals("c:\\app\\jenkins\\workspace\\foo\\bar\\manchu", new FilePath(winPath, "foo\\bar\\manchu").getRemote());
assertEquals("/opt/jenkins/workspace/foo/bar/manchu", new FilePath(nixPath, "foo\\bar\\manchu").getRemote());
assertEquals("/opt/jenkins/workspace/foo/bar/manchu", new FilePath(nixPath, "foo/bar\\manchu").getRemote());
assertEquals("/opt/jenkins/workspace/foo/bar/manchu", new FilePath(nixPath, "foo/bar/manchu").getRemote());
}
}