Skip to content

feat: allow custom test cases in the test runner #13

Description

@Jatin-Shihora

When you press Ctrl+T to test, it only runs against the sample test cases provided by LeetCode. If you want to test edge cases (empty arrays, large inputs, negative numbers), you have to submit and hope for the best, or go to the website to add custom inputs.

What should happen
Before running tests, show a prompt or overlay where users can:

  • See the default sample test cases
  • Edit them or add new ones
  • Run against all of them (default + custom)

Things to consider

  • The LeetCode API accepts custom test input as a string in the test request. Check api/submissions.py to see how test cases are currently passed
  • The input format varies per problem (arrays, strings, trees, linked lists). The user needs to enter them in LeetCode's expected format
  • A simple text input area (reusing the editor component) would work for entering custom cases
  • Custom test cases could be saved per problem in ~/.leetshell/solutions/ alongside the solution file
  • Start simple: just let users edit the test input string before running. No need to parse or validate the format

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions