ByteArrayOutputStream err = new ByteArrayOutputStream();
this.setOut(new PrintStream(out));
this.setErr(new PrintStream(err));
String resultString = "";
ErrorReporter savedErrorReporter = cx.getErrorReporter();
cx.setErrorReporter(new ToolErrorReporter(false, this.getErr()));
try {
testCount++;
Object result = cx.evaluateString(scope, inputString,
"doctest input", 1, null);
if (result != Context.getUndefinedValue() &&