From: Curt A. <ca...@us...> - 2006-03-17 00:41:57
|
Update of /cvsroot/ant-contrib/cpptasks/test/junit/net/sf/antcontrib/cpptasks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11076/junit/net/sf/antcontrib/cpptasks Modified Files: TestCUtil.java Log Message: Bug 1400662: Additional tests for CUtil.getRelativePath Index: TestCUtil.java =================================================================== RCS file: /cvsroot/ant-contrib/cpptasks/test/junit/net/sf/antcontrib/cpptasks/TestCUtil.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestCUtil.java 16 Mar 2006 22:40:55 -0000 1.12 --- TestCUtil.java 17 Mar 2006 00:41:54 -0000 1.13 *************** *** 93,96 **** --- 93,112 ---- assertEquals(expected, rel); } + public void testGetRelativePath9() throws IOException { + String canonicalBase = new + File("/foo/bar/something").getCanonicalPath(); + String rel = CUtil.getRelativePath(canonicalBase, + new File("/foo/bar/somethingElse")); + String expected = ".." + File.separator + "somethingElse"; + assertEquals(expected, rel); + } + public void testGetRelativePath10() throws IOException { + String canonicalBase = new + File("/foo/bar/something").getCanonicalPath(); + String rel = CUtil.getRelativePath(canonicalBase, + new File("/foo/bar/something else")); + String expected = ".." + File.separator + "something else"; + assertEquals(expected, rel); + } public void testParsePath1() { File[] files = CUtil.parsePath("", ";"); |