Skip to content

Commit 6995142

Browse files
tenfyzhongianding1
authored andcommitted
Fix state of the test or submit result.
1 parent 4fe7e7c commit 6995142

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

autoload/leetcode.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,16 @@ function! s:CheckRunCodeTask(timer) abort
10561056

10571057
if task_name == 'test_solution' || task_name == 'submit_solution'
10581058
if type(task_output) == v:t_dict
1059+
if task_name == 'test_solution'
1060+
if task_output['state'] == 'Finished' &&
1061+
\task_output['answer'] != task_output['expected_answer']
1062+
let task_output['state'] = 'Wrong Answer'
1063+
endif
1064+
elseif task_name == 'submit_solution'
1065+
if task_output['state'] == 'Finished'
1066+
let task_output['state'] = 'Accepted'
1067+
endif
1068+
endif
10591069
call s:ShowRunResultInPreview(task_output)
10601070
endif
10611071
else

0 commit comments

Comments
 (0)