Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uceme
mjtest
Commits
4c70f2c3
Commit
4c70f2c3
authored
Nov 02, 2016
by
Johannes Bechberger
Browse files
Add line numbers in report and two test cases
parent
8e19d593
Changes
1
Hide whitespace changes
Inline
Side-by-side
mjtest/test/tests.py
View file @
4c70f2c3
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment