Skip to content

Commit 172a49c

Browse files
committed
Fixed test runner.vim
1 parent 8519900 commit 172a49c

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

test/results.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
Test_check_uncheck_todo_keybinding(): pass
12
Test_markdown_lists(): pass

test/run_tests.cmd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ REM
2121

2222
SET "VIM_CMD=%VIMPRG% --clean -u %VIMRC% -i NONE"
2323

24-
25-
Check if the vimrc file was created successfully
24+
REM Check if the vimrc file was created successfully
2625
if NOT EXIST "%VIMRC%" (
2726
echo "ERROR: Failed to create %VIMRC%"
2827
exit /b 1
@@ -32,10 +31,10 @@ REM Display the contents of VIMRC (for debugging purposes)
3231
type "%VIMRC%"
3332

3433
REM Run Vim with the specified configuration and additional commands
35-
REM %VIM_CMD% -c "vim9cmd g:TestName = 'test_markdown_extras.vim'" -S "runner.vim"
34+
%VIM_CMD% -c "vim9cmd g:TestName = 'test_markdown_extras.vim'" -S "runner.vim"
3635
REM If things go wrong uncomment the following line and see e.g. if the
3736
REM vimrc_for_test is valid, check :messages and so on.
38-
%VIM_CMD% -c "vim9cmd g:TestName = 'test_markdown_extras.vim'" -c "e README.md"
37+
REM %VIM_CMD% -c "vim9cmd g:TestName = 'test_markdown_extras.vim'" -c "e README.md"
3938

4039
REM Check the exit code of Vim command
4140
if %ERRORLEVEL% EQU 0 (

test/runner.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ vim9script
33
# The global variable TestName should be set to the name of the file
44
# containing the tests.
55

6-
# source common.vim
6+
# Uncomment the following to debug this script
7+
# g:TestName = 'test_markdown_extras.vim'
78

89
def RunTests()
910
set nomore
@@ -20,6 +21,8 @@ def RunTests()
2021
writefile(['No tests are found'], 'results.txt')
2122
return
2223
endif
24+
25+
# Execute the functions
2326
for f in fns
2427
v:errors = []
2528
v:errmsg = ''
@@ -29,6 +32,7 @@ def RunTests()
2932
catch
3033
add(v:errors, $'Error: Test {f} failed with exception {v:exception} at {v:throwpoint}')
3134
endtry
35+
3236
if v:errmsg != ''
3337
add(v:errors, $'Error: Test {f} generated error {v:errmsg}')
3438
endif

test/test_markdown_extras.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ def g:Test_markdown_lists()
118118

119119
# redraw!
120120
# sleep 3
121-
122-
quit!
123-
121+
:%bw!
124122
Cleanup_markdown_testfile()
125123
enddef
126124

@@ -138,4 +136,7 @@ def g:Test_check_uncheck_todo_keybinding()
138136
execute $"silent norm! \<Plug>MarkdownToggleCheck"
139137
echom assert_true(getline('.') =~ '- \[ \] ')
140138

139+
:%bw!
140+
Cleanup_markdown_testfile()
141+
141142
enddef

0 commit comments

Comments
 (0)