Skip to content

Commit

Permalink
fail test case if there is no stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
baybatu committed Feb 11, 2018
1 parent 291d233 commit 137e3a2
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -33,7 +33,6 @@ protected void interpretInternal(ChallengeEvaluationContext context) {
eachTestCaseWithResult.setResultMessage(interpretResponse.getStdErr());
}
processTestCase(eachTestCaseWithResult, interpretResponse.getStdOut());
eachTestCaseWithResult.setResultMessage(interpretResponse.getStdErr());
}
context.decideInterpreterResult();
}
Expand All @@ -45,8 +44,12 @@ private InterpretResponse wrapWithFunctionCallAndGetResult(String sourceCode, Te
}

private void processTestCase(TestCaseWithResult testCaseWithResult, String resultValue) {
TestCaseResult testCaseResult = TestCaseResult.FAILED;
if (StringUtils.isBlank(resultValue)) {
testCaseWithResult.setTestCaseResult(TestCaseResult.FAILED);
return;
}

TestCaseResult testCaseResult = TestCaseResult.FAILED;
DataType outputType = testCaseWithResult.getTestCaseUnderTest().getOutputType();
Object expectedJavaObject = outputType.toJavaObject(testCaseWithResult.getTestCaseUnderTest().getOutput());
if (outputType == DataType.Integer) {
Expand Down

0 comments on commit 137e3a2

Please sign in to comment.