apply formatting

This commit is contained in:
Eugene Yokota
2019-04-20 23:23:13 -04:00
parent 2ac7501c7c
commit 98ec0075f4
9 changed files with 105 additions and 67 deletions
@@ -15,7 +15,9 @@ class ScriptRunner {
def processStatement(handler: StatementHandler, statement: Statement): Unit = {
val state = states(handler).asInstanceOf[handler.State]
val nextState =
try { Right(handler(statement.command, statement.arguments, state)) } catch {
try {
Right(handler(statement.command, statement.arguments, state))
} catch {
case e: Exception => Left(e)
}
nextState match {
@@ -42,7 +44,9 @@ class ScriptRunner {
statements foreach (Function.tupled(processStatement))
} finally {
for (handler <- handlers; state <- states.get(handler)) {
try { handler.finish(state.asInstanceOf[handler.State]) } catch { case e: Exception => () }
try {
handler.finish(state.asInstanceOf[handler.State])
} catch { case e: Exception => () }
}
}
}
@@ -75,21 +75,22 @@ final class ScriptedTests(
val g = groupDir.getName
val n = nme.getName
val str = s"$g / $n"
() =>
{
println("Running " + str)
testResources.readWriteResourceDirectory(g, n) { testDirectory =>
val disabled = new File(testDirectory, "disabled").isFile
if (disabled) {
log.info("D " + str + " [DISABLED]")
None
} else {
try { scriptedTest(str, testDirectory, prescripted, log); None } catch {
case _: TestException | _: PendingTestSuccessException => Some(str)
}
() => {
println("Running " + str)
testResources.readWriteResourceDirectory(g, n) { testDirectory =>
val disabled = new File(testDirectory, "disabled").isFile
if (disabled) {
log.info("D " + str + " [DISABLED]")
None
} else {
try {
scriptedTest(str, testDirectory, prescripted, log); None
} catch {
case _: TestException | _: PendingTestSuccessException => Some(str)
}
}
}
}
}
}
@@ -149,7 +150,9 @@ final class ScriptedTests(
case e: Exception =>
testFailed()
if (!pending) throw e
} finally { buffered.clearBuffer() }
} finally {
buffered.clearBuffer()
}
}
}