Skip to content

Commit f6b0c28

Browse files
authored
Merge pull request #110 from testmycode/parse_fix
Don't split ':' more than once
2 parents 243b7ab + 3116611 commit f6b0c28

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tmc-langs-python3/src/main/java/fi/helsinki/cs/tmc/langs/python3/Python3TestResultParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private String parseTestName(String testName) {
7373
private String parseTestMessage(String testMessage) {
7474
String matcher = testMessage.toLowerCase();
7575
if (matcher.matches("^(true|false) is not (true|false) :[\\s\\S]*")) {
76-
return testMessage.split(":")[1].trim();
76+
return testMessage.split(":", 2)[1].trim();
7777
}
7878
return testMessage;
7979
}

tmc-langs-python3/src/test/java/fi/helsinki/cs/tmc/langs/python3/Python3PluginTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void testFailingTestNoBoolIsBool() {
123123
assertEquals(RunResult.Status.TESTS_FAILED, runResult.status);
124124
TestResult testResult = runResult.testResults.get(0);
125125
assertEquals(
126-
"No false is not true at beginning\n newlines are kept",
126+
"No false is not true at beginning\n newlines are:kept:not:split",
127127
testResult.getMessage());
128128
}
129129

tmc-langs-python3/src/test/resources/failparsing/test/test_failparsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class FailParsingTest(unittest.TestCase):
66

77
@points('1.1')
88
def test_new(self):
9-
self.assertFalse(True, "No false is not true at beginning\n newlines are kept")
9+
self.assertFalse(True, "No false is not true at beginning\n newlines are:kept:not:split")
1010

1111
if __name__ == '__main__':
1212
unittest.main()

0 commit comments

Comments
 (0)