ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/util FileUtilsTest.java
Date Tue, 22 Jul 2003 14:52:45 GMT
bodewig     2003/07/22 07:52:45

  Modified:    src/testcases/org/apache/tools/ant/util FileUtilsTest.java
  Log:
  removeLeadingPath doesn't work if leading is a filesystem root - found by Antoine
  
  Revision  Changes    Path
  1.22      +9 -0      ant/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java
  
  Index: FileUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- FileUtilsTest.java	16 Jul 2003 10:43:15 -0000	1.21
  +++ FileUtilsTest.java	22 Jul 2003 14:52:45 -0000	1.22
  @@ -421,6 +421,15 @@
                                                 new File("/foo/bar/")));
           assertEquals("", fu.removeLeadingPath(new File("/foo/bar/"),
                                                 new File("/foo/bar")));
  +
  +        String expected = "foo/bar".replace('\\', File.separatorChar)
  +            .replace('/', File.separatorChar);
  +        assertEquals(expected, fu.removeLeadingPath(new File("/"),
  +                                                    new File("/foo/bar")));
  +        assertEquals(expected, fu.removeLeadingPath(new File("c:/"),
  +                                                    new File("c:/foo/bar")));
  +        assertEquals(expected, fu.removeLeadingPath(new File("c:\\"),
  +                                                    new File("c:\\foo\\bar")));
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message