package com.google.classpath;

import java.net.URL;
import java.util.List;

import junit.framework.TestCase;

public class ColonDelimitedStringParserTest extends TestCase {
     List<String> list;

    public void testParsesEmptyProperly() throws Exception {
        list = new ColonDelimitedStringParser("")
                .getStrings();
        assertEquals(1, list.size());
        assertEquals("", list.get(0));        
    }

    public void testParsesNormally() throws Exception {
        list = new ColonDelimitedStringParser("one:two:three.and.a.half")
                .getStrings();
        assertEquals(3, list.size());
        assertEquals("one", list.get(0));
        assertEquals("two", list.get(1));
        assertEquals("three.and.a.half", list.get(2));
    }

  public void testParseAndAddToClasspathList() throws Exception {
    String classpath = "test-one.jar;";
    List<URL> completeClasspath = new ColonDelimitedStringParser(classpath).getURLs();
    assertStringEndsWith("test-one.jar", completeClasspath.get(0).toString());

    completeClasspath.clear();
    classpath = "lib/one.jar:lib/two.jar;three.jar";
    completeClasspath = new ColonDelimitedStringParser(classpath).getURLs();

    assertStringEndsWith("lib/one.jar", completeClasspath.get(0).toString());
    assertStringEndsWith("lib/two.jar", completeClasspath.get(1).toString());
    assertStringEndsWith("three.jar", completeClasspath.get(2).toString());
  }

  private void assertStringEndsWith(String expectedEnding, String fullToTest) {
    assertTrue(fullToTest.endsWith(expectedEnding));
  }
}

@@ -24,16 +24,37 @@
 spath;%0A%0A
+import java.io.File;%0A
 import j
@@ -66,16 +66,16 @@
 et.URL;%0A
-
 import j
@@ -430,24 +430,16 @@
 get(0));
-        
 %0A    %7D%0A%0A
@@ -889,10 +889,30 @@
 .jar
-;
 %22
+ + File.pathSeparator
 ;%0A  
@@ -1139,21 +1139,79 @@
 .jar
-:lib/two.jar;
+%22 + File.pathSeparator + %22lib/two.jar%22%0A        + File.pathSeparator + %22
 thre
@@ -1613,16 +1613,16 @@
 Test) %7B%0A
-
     asse
@@ -1628,16 +1628,28 @@
 ertTrue(
+fullToTest, 
 fullToTe

Clean up path seperator issues with window/unix