Add default test for output validator flags in problem.yaml & testdata.yaml + display - #3655
Conversation
96bdb91 to
db1baa7
Compare
0562d1d to
93a1267
Compare
| $orig_compare_args = []; | ||
| if ($compare_args !== null && strlen($compare_args) > 0) { | ||
| $orig_compare_args = explode(' ', $compare_args); | ||
| $orig_compare_args = str_getcsv($compare_args, separator: ' ', escape: ''); |
There was a problem hiding this comment.
This might still not what we want, e.g. --flag1 --flag2 (double spaces in between and trailing space) is parsed into ['--flag1', '', '--flag2', ''], isn't it?
There was a problem hiding this comment.
hmmm, https://icpc.io/problem-package-format/spec/2025-09.html#test-case-configuration says this is a "sequence of strings"
There was a problem hiding this comment.
I think we don´t implement 2025-09 but https://icpc.io/problem-package-format/spec/legacy.html#test-data-groups where this is a string but only if itś the name. So I suspect we need some extra work here.
There was a problem hiding this comment.
I need to figure what spec will be used for the next challenge...
There was a problem hiding this comment.
Can we merge this for now and open another PR to fix the string vs map of string vs sequence of strings
I'm fine with working on that, I just prefer to not have to further extend this PR with extra features.
| } | ||
| if (isset($yamlData['output_validator_flags'])) { | ||
| $testcaseGroup->setOutputValidatorFlags($yamlData['output_validator_flags']); | ||
| foreach(['flags', 'args'] as $postFix) { |
There was a problem hiding this comment.
Should we check whether the user specifies both flags and treat is as an error if so? (same in the other commit, also consider linking to the spec in the corresponding commit messages)
There was a problem hiding this comment.
I added a test which checks for this edgecase,
Before we would split: '--message "my message"' as ['--message', '"my', 'message"']
It's easy to misremember the spec and provide the wrong ones. This follows the principle that we want to be lenient when importing.
68fcd07 to
1b32e9b
Compare
Extracted some parts of #3623 but also extended from there with the usage of the options in the testcase group.
This adds: