Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Split a test into smaller cases #34

Open
TroySigX opened this issue May 12, 2023 · 5 comments
Open

Feature request: Split a test into smaller cases #34

TroySigX opened this issue May 12, 2023 · 5 comments

Comments

@TroySigX
Copy link

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

@TroySigX
Copy link
Author

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.

@xeluxee
Copy link
Owner

xeluxee commented May 14, 2023

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.

This feature cannot be achieved because every problem has a different input structure. But there are some workaround:

  1. As you suggested, visual select a region and create a testcase
  2. Put some dashes between lines to split them into single testcases:
4
----
1 2
----
2 3
----
4 5
----
5 5

@TroySigX

This comment was marked as outdated.

@TroySigX
Copy link
Author

TroySigX commented May 14, 2023

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.

@TroySigX
Copy link
Author

Hi, any updates on this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants