Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fja
eval
Commits
4780d4ce
Commit
4780d4ce
authored
Jun 09, 2021
by
Vladimír Štill
Browse files
test: Tweak style in checker
parent
0265e6dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_checker.py
View file @
4780d4ce
...
...
@@ -18,7 +18,7 @@ def run_checker(task_file: FilePath, solution_file: FilePath, html: bool) \
task
=
task_handle
.
read
()
args
=
[
sys
.
executable
,
# the Python itself
"fja_checker/__main__.py"
]
"fja_checker/__main__.py"
]
if
html
:
args
.
append
(
"--html"
)
return
subprocess
.
run
(
args
+
[
solution_file
,
f
"-o
{
task
}
"
],
...
...
@@ -37,7 +37,7 @@ def run_tests(test_dir: FilePath, html: bool) -> None:
files
=
filter
(
lambda
x
:
os
.
path
.
isfile
(
x
),
map
(
lambda
x
:
os
.
path
.
join
(
test_dir
,
x
),
os
.
listdir
(
test_dir
)))
tests
:
Dict
[
FilePath
,
Set
[
FilePath
]]
=
dict
()
tests
:
Dict
[
FilePath
,
Set
[
FilePath
]]
=
{}
for
basename
,
suff
in
map
(
lambda
x
:
x
.
split
(
'.'
,
1
),
files
):
if
suff
.
endswith
(
"ok"
)
or
suff
.
endswith
(
"nok"
):
tests
.
setdefault
(
f
"
{
basename
}
.q"
,
set
()).
add
(
f
"
{
basename
}
.
{
suff
}
"
)
...
...
@@ -65,17 +65,17 @@ def run_tests(test_dir: FilePath, html: bool) -> None:
# Test entry points
def
test_reg_text
():
def
test_reg_text
()
->
None
:
run_tests
(
"test/checker/reg"
,
False
)
def
test_reg_html
():
def
test_reg_html
()
->
None
:
run_tests
(
"test/checker/reg"
,
True
)
def
test_cfl_text
():
def
test_cfl_text
()
->
None
:
run_tests
(
"test/checker/cfl"
,
False
)
def
test_cfl_html
():
def
test_cfl_html
()
->
None
:
run_tests
(
"test/checker/cfl"
,
True
)
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