提交 0fd3d307 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix multiple output of the same error in one more place in TestScript

上级 d50417c7
...@@ -261,7 +261,6 @@ public class TestScript extends TestBase { ...@@ -261,7 +261,6 @@ public class TestScript extends TestBase {
write(sql); write(sql);
} else if (sql.startsWith(">")) { } else if (sql.startsWith(">")) {
addWriteResultError("<command>", sql); addWriteResultError("<command>", sql);
TestBase.logErrorMessage(errors.toString());
} else if (sql.endsWith(";")) { } else if (sql.endsWith(";")) {
write(sql); write(sql);
buff.append(sql, 0, sql.length() - 1); buff.append(sql, 0, sql.length() - 1);
...@@ -527,7 +526,6 @@ public class TestScript extends TestBase { ...@@ -527,7 +526,6 @@ public class TestScript extends TestBase {
if (ex != null) { if (ex != null) {
TestBase.logError("script", ex); TestBase.logError("script", ex);
} }
TestBase.logErrorMessage(errors.toString());
if (failFast) { if (failFast) {
conn.close(); conn.close();
System.exit(1); System.exit(1);
...@@ -535,17 +533,18 @@ public class TestScript extends TestBase { ...@@ -535,17 +533,18 @@ public class TestScript extends TestBase {
} }
} else { } else {
addWriteResultError("<nothing>", s); addWriteResultError("<nothing>", s);
TestBase.logErrorMessage(errors.toString());
putBack = compare; putBack = compare;
} }
write(s); write(s);
} }
private void addWriteResultError(String expected, String got) { private void addWriteResultError(String expected, String got) {
int idx = errors.length();
errors.append(fileName).append('\n'); errors.append(fileName).append('\n');
errors.append("line: ").append(in.getLineNumber()).append('\n'); errors.append("line: ").append(in.getLineNumber()).append('\n');
errors.append("exp: ").append(expected).append('\n'); errors.append("exp: ").append(expected).append('\n');
errors.append("got: ").append(got).append('\n'); errors.append("got: ").append(got).append('\n');
TestBase.logErrorMessage(errors.substring(idx));
} }
private void write(String s) { private void write(String s) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论