Skip to content

Commit

Permalink
generate: skip unlisted invalid_answers (was _outputs)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorehusfeldt committed Feb 2, 2024
1 parent a51c4cc commit 66c58dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def add_testdata_to_cache():

if not generator_up_to_date:
# Generate .ans and .interaction if needed.
if not config.args.no_solution and testcase.root not in ["invalid_inputs", "invalid_outputs"]:
if not config.args.no_solution and testcase.root not in ["invalid_inputs", "invalid_answers"]:
if not problem.interactive:
# Generate a .ans if not already generated by earlier steps.
if not testcase.ans_path.is_file():
Expand Down Expand Up @@ -1290,7 +1290,7 @@ def parse(key, name, yaml, parent, listed=True):
nonlocal testcase_id
# Skip unlisted `data/bad` directory: we should not generate .ans files there.
if (
name in ['bad', 'invalid_inputs', 'invalid_outputs']
name in ['bad', 'invalid_inputs', 'invalid_answers']
and parent.path == Path('.')
and listed is False
):
Expand Down
2 changes: 1 addition & 1 deletion bin/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def validate_data(problem, mode:validate.Mode, constraints: dict|bool|None=None)
Arguments:
mode: validate.Mode.INPUT | validate.Mode.ANSWER | (not implemented) Validate.Mode.OUTPUT
constraints: True | dict | None. True means "do check constraints but discard the result."
False: TODO is this ever used?
False: TODO is this ever used?
Return:
True if all validation was successful. Successful validation includes, e.g.,
correctly rejecting invalid inputs.
Expand Down

0 comments on commit 66c58dc

Please sign in to comment.