FileDocCategorySizeDatePackage
P4ChangeTest.javaAPI DocApache Ant 1.701752Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs.optional.perforce

P4ChangeTest

public class P4ChangeTest extends TestCase
Basic testcase to ensure that backslashing is OK.

Fields Summary
protected P4Change
p4change
Constructors Summary
public P4ChangeTest(String s)

        super(s);
    
Methods Summary
protected voidsetUp()

        p4change = new P4Change();
    
public voidtestBackslash()

        String input = "comment with a / inside";
        String output = P4Change.backslash(input);
        assertEquals("comment with a \\/ inside", output);
    
public voidtestSubstitute()

        Perl5Util util = new Perl5Util();
        String tosubstitute = "xx<here>xx";
        String input = P4Change.backslash("/a/b/c/");
        String output = util.substitute("s/<here>/" + input + "/", tosubstitute);
        assertEquals("xx/a/b/c/xx", output);