Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
adapt to output differences in different versions of svn client
git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/svn/trunk@348658 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bodewig committed Nov 24, 2005
1 parent 6ff2d5d commit c96e011017b01d06ff87e01a3c1290d6c084c0ba
Showing 1 changed file with 21 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2005 The Apache Software Foundation
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,26 @@ public void testAbstractSvnTask() {
public void testRevisionAttribute() {
File f = getProject().resolveFile("tmpdir/trunk/build.xml");
assertTrue("starting empty", !f.exists());
expectLogContaining("revision-attribute", "A trunk/build.xml");

// used to be
// expectLogContaining("revision-attribute", "A trunk/build.xml");
// but the number of spaces between the status and the file depends
// on the version of the command line client
executeTarget("revision-attribute");
String log = getLog();
int buildFileIndex = log.indexOf("trunk/build.xml");
assertTrue("expected message about build.xml, log was: " + log,
buildFileIndex > -1);
for (int i = buildFileIndex - 1; i > -1; --i) {
char c = log.charAt(i);
if (c != ' ') {
assertEquals('A', c);
break;
}
}
assertTrue("expexted 'A' status for build.xml, log was:" +log,
buildFileIndex > -1);

assertTrue("now it is there", f.exists());
}
}

0 comments on commit c96e011

Please sign in to comment.