leetcode-cli icon indicating copy to clipboard operation
leetcode-cli copied to clipboard

[Feature request] edit test case

Open kgfly opened this issue 4 months ago • 6 comments

On web, we can edit test case. Can cli support this feature?

Thanks for your consideration.

kgfly avatar Aug 03 '25 15:08 kgfly

If i'm not mistaken, we can go with leetcode edit

clearloop avatar Aug 03 '25 22:08 clearloop

Thanks @clearloop ,

edit -> edit code, which is for submission.

My ask is about: edit test code, aka test case, test input code.

kgfly avatar Aug 08 '25 20:08 kgfly

Thanks @clearloop ,

edit -> edit code, which is for submission.

My ask is about: edit test code, aka test case, test input code.

you can change the test case by provide a cli param like: leetcode t 58 '"a"'

junjiexh avatar Aug 19 '25 09:08 junjiexh

Thanks, @junjiexh . How to test if it has mulit parameters?

eg leetcode t 1 '[2,7,11,15] 9' [INFO leetcode_cli::plugins::leetcode] Sending code to judge... -> Runtime Error [2,7,11,15] 9 is not a valid value of type integer[]

Is it possible to document it?

kgfly avatar Aug 23 '25 22:08 kgfly

Thanks, @junjiexh . How to test if it has mulit parameters?

eg leetcode t 1 '[2,7,11,15] 9' [INFO leetcode_cli::plugins::leetcode] Sending code to judge... -> Runtime Error [2,7,11,15] 9 is not a valid value of type integer[]

Is it possible to document it?

If I remember correctly, you can try this: leetcode t 1 '[2,7,11,15]\n9'

junjiexh avatar Aug 24 '25 08:08 junjiexh

Thanks, @junjiexh .

Q1: is there a way to list the existing test cases? Eg, for the two sum problem, how to list these 3 default test cases using the cli?

Image

Q2: how to run the first 2 test cases (in one commnad) using the cli?

etc is

leetcode t 1 '[2,7,11,15]\n9\n[3,2,4]\n6'

correct?

kgfly avatar Aug 24 '25 13:08 kgfly