Commit 4c70f2c3 authored by Johannes Bechberger's avatar Johannes Bechberger

Add line numbers in report and two test cases

parent 8e19d593
......@@ -273,9 +273,9 @@ class BasicTestResult(TestResult):
return "incorrect return code"
def long_message(self) -> str:
file_content = ""
file_content = []
with open(self.test_case.file, "r") as f:
file_content = f.readlines()
file_content = [line.rstrip() for line in f]
others = []
for title, content, long_text in self.other_texts:
if long_text:
......@@ -316,6 +316,9 @@ Return code: {}
def _ident(self, text: Union[str,List[str]]) -> str:
arr = text if isinstance(text, list) else text.split("\n")
return " " + "\n ".join(arr)
if len(arr) == 0 or text == "":
return ""
arr = ["[{:04d}] {:s}".format(i + 1, l) for (i, l) in enumerate(arr)]
return "\n".join(arr)
import mjtest.test.syntax_tests
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment