Feature request: Split a test into smaller cases
For a test with multiple test cases. e.g let there be 4 test cases, and each test takes a and b as inputs:
4
1 2
2 3
4 5
5 5
Conventionally, competitest would just store this test into a single file (input0.txt), but instead, I'd like it to be broken down into smaller cases (e.g storing the tests in files input0, input1, input2, and input3), with each file in the following format:
1
a b
This makes it easier to debug while in the contest
Suggested solution: If the feature above cannot be achieved, there's another alternative:
When editing a test with multiple test cases (example test), being able to choose a region (using visual mode) and create a new test case (using :CompetiTestAdd or something similar) based on that chosen area would be great.
Suggested solution: If the feature above cannot be achieved, there's another alternative: When editing a test with multiple test cases (example test), being able to choose a region (using visual mode) and create a new test case (using
:CompetiTestAddor something similar) based on that chosen area would be great.
This feature cannot be achieved because every problem has a different input structure. But there are some workaround:
- As you suggested, visual select a region and create a testcase
- Put some dashes between lines to split them into single testcases:
4
----
1 2
----
2 3
----
4 5
----
5 5
Thanks @xeluxee! But what about the output, how about putting some dashes (or tickback, the symbol to the left of number 1) to seperate the testcases' output
Here's what I think, how about having a command :Splitcases x y, where x is the test number to be split, and y is the splitting character between the cases (in your example, y is the dashes ----).
To further enhance the experience, we should have the option to set the default splitting character y in the setup.
Hi, any updates on this feature?