提交 4a12979b 编写于 作者: K ksrini

7119487: JavacParserTest.java test fails on Windows platforms

Reviewed-by: jjg
上级 f09d757f
......@@ -25,7 +25,7 @@
* @test
* @bug 7073631
* @summary tests error and diagnostics positions
* @author jan.lahoda@oracle.com
* @author Jan Lahoda
*/
import com.sun.source.tree.BinaryTree;
......@@ -83,6 +83,12 @@ public class JavacParserTest extends TestCase {
return text;
}
}
/*
* converts Windows to Unix style LFs for comparing strings
*/
private String normalize(String in) {
return in.replace(System.getProperty("line.separator"), "\n");
}
public CompilationUnitTree getCompilationUnitTree(String code) throws IOException {
......@@ -95,9 +101,7 @@ public class JavacParserTest extends TestCase {
public List<String> getErroneousTreeValues(ErroneousTree node) {
List<String> values = new ArrayList<>();
if (node.getErrorTrees() != null) {
for (Tree t : node.getErrorTrees()) {
values.add(t.toString());
}
......@@ -786,7 +790,7 @@ public class JavacParserTest extends TestCase {
@Override
public Void visitErroneous(ErroneousTree node, Void p) {
values.add(getErroneousTreeValues(node).toString());
values.add(normalize(getErroneousTreeValues(node).toString()));
return null;
}
}.scan(cut, null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册