Skip to content

Commit

Permalink
Fix issue 11 (misleading crosstest messages)
Browse files Browse the repository at this point in the history
Merge pull request #12 from jacquard-autograder/issue11
  • Loading branch information
espertus authored Mar 12, 2024
2 parents 9b5bc83 + d8cc8b4 commit be84645
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/spertus/jacquard/crosstester/CrossTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
public class CrossTester {
private static final String DELIM = "\\s*,\\s*";
private static final String FOUND_BUG_TEMPLATE = "Test %s SUCCEEDED by reporting a bug in the hidden buggy implementation: %s\n";
private static final String MISSED_BUG_TEMPLATE = "Test %s DID NOT report an existing bug in the hidden buggy implementation\n";
private static final String BLAMED_CORRECT_TEMPLATE = "Test %s FAILED by reporting a bug in the hidden correct implementation: %s\n";
private static final String PASSED_CORRECT_TEMPLATE = "Test %s SUCCEEDED by not falsely reporting a bug in the hidden correct implementation\n";
private static final String FOUND_BUG_TEMPLATE = "Test %s SUCCEEDED by reporting a bug in the %s implementation of %s(): %s\n";
private static final String MISSED_BUG_TEMPLATE = "Test %s FAILED to report an existing bug in the %s implementation of %s()\n";
private static final String BLAMED_CORRECT_TEMPLATE = "Test %s FAILED by reporting a bug in the %s implementation of %s(): %s\n";
private static final String PASSED_CORRECT_TEMPLATE = "Test %s SUCCEEDED by not falsely reporting a bug in the %s implementation of %s()\n";

private final Class<?> testClass;
// The next three instance variables are initialized in processCsvFile().
Expand Down Expand Up @@ -255,11 +255,11 @@ private Result generateResult(final int putIndex, final int mutIndex, final List
for (final TestResult tr : mutTestResults) {
if (tr.passed()) {
String template = testsShouldPass ? PASSED_CORRECT_TEMPLATE : MISSED_BUG_TEMPLATE;
sb.append(String.format(template, tr.testName()));
sb.append(String.format(template, tr.testName(), tr.packageUnderTestName(), tr.methodUnderTestName()));
successes++;
} else {
String template = testsShouldPass ? BLAMED_CORRECT_TEMPLATE : FOUND_BUG_TEMPLATE;
sb.append(String.format(template, tr.testName(), tr.message()));
sb.append(String.format(template, tr.testName(), tr.packageUnderTestName(), tr.methodUnderTestName(), tr.message()));
failures++;
}
if (!tr.output().isEmpty()) {
Expand Down

0 comments on commit be84645

Please sign in to comment.