The current regex cannot check correctly in some cases.
For example, if the test structure is test[number]/in[*].out, the old check will capture [number].in and the file will pass as an input file (while it should not).
There is also a check whether all files are in the same format. Some files will be recognized as an input/output file of one format but not another. For example, TEST01/inftrain.out will be recognized as an input file instead, from the DMOJ regex. This is why this check is in place, and the DMOJ regex is put at the end as the fallback regex.
How Has This Been Tested?
On local version of VNOJ.
Tested with:
A Polygon-style test data (in: test/[number], out: test/[number].a
A Themis-style test data (in: Test[number]/inftrain.inp, out: Test[number]/inftrain.out)
NOTE: Localization has not been updated.
Checklist
[x] I have explained the purpose of this PR.
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the README/documentation
[ ] Any dependent changes have been merged and published in downstream modules
[ ] Informed of breaking changes, testing and migrations (if applicable).
[x] Attached screenshots (if applicable).
By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.
Description
Split the old regex into smaller regex's
Type of change: bug fix, refactor
What
Instead of using a single regex, the check will go through 3 different regex's. The order of checking is:
Why
The current regex cannot check correctly in some cases.
For example, if the test structure is
test[number]/in[*].out
, the old check will capture[number].in
and the file will pass as an input file (while it should not).There is also a check whether all files are in the same format. Some files will be recognized as an input/output file of one format but not another. For example,
TEST01/inftrain.out
will be recognized as an input file instead, from the DMOJ regex. This is why this check is in place, and the DMOJ regex is put at the end as the fallback regex.How Has This Been Tested?
On local version of VNOJ.
Tested with:
test/[number]
, out:test/[number].a
Test[number]/inftrain.inp
, out:Test[number]/inftrain.out
)NOTE: Localization has not been updated.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.