Skip to content

Commit 4f9fd6d

Browse files
committed
Adjusted test running scripts
1 parent 839bbc4 commit 4f9fd6d

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

test/results.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
1-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 12: Pattern '- ' does not match ''
2-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 17: Pattern '- bar' does not match 'bar'
3-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 40: Expected True but got false
4-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 52: Expected True but got false
5-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 66: Pattern '- bar' does not match 'bar'
6-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 68: Pattern ' - foo' does not match ' foo'
7-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 70: Pattern ' - bar' does not match 'bar'
8-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 72: Pattern ' - foo' does not match ' foo'
9-
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>19_RunTests[20]..Test_markdown_lists line 74: Pattern ' - bar' does not match 'bar'
1+
command line..script C:\Users\yt75534\vimfiles\plugins\vim-markdown-extras\test\runner.vim[46]..function <SNR>22_RunTests[20]..Test_markdown_lists line 74: Pattern ' - barrr' does not match ' - bar'
102
Test_markdown_lists(): FAIL

test/run_tests.cmd

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ SETLOCAL
66
REM Define the paths and files
77
SET "VIMPRG=vim.exe"
88
SET "VIMRC=vimrc_for_tests"
9-
SET "VIM_CMD=%VIMPRG% --clean -u %VIMRC% -i NONE"
109

1110
REM Create or overwrite the vimrc file with the initial setting
1211
REM
@@ -17,12 +16,15 @@ REM
1716
echo set nocompatible
1817
echo set runtimepath+=..
1918
echo set runtimepath+=../after
20-
echo autoindent
19+
echo set autoindent
2120
echo filetype plugin indent on
2221
echo # ----------------------------------
2322
) >> "%VIMRC%"
2423

25-
REM Check if the vimrc file was created successfully
24+
SET "VIM_CMD=%VIMPRG% --clean -u %VIMRC%"
25+
26+
27+
Check if the vimrc file was created successfully
2628
if NOT EXIST "%VIMRC%" (
2729
echo "ERROR: Failed to create %VIMRC%"
2830
exit /b 1
@@ -33,6 +35,9 @@ type "%VIMRC%"
3335

3436
REM Run Vim with the specified configuration and additional commands
3537
%VIM_CMD% -c "vim9cmd g:TestName = 'test_markdown_extras.vim'" -S "runner.vim"
38+
REM If things go wrong uncomment the following line and see e.g. if the
39+
REM vimrc_for_test is valid, check :messages and so on.
40+
REM %VIM_CMD% -c "vim9cmd g:TestName = 'test_markdown_extras.vim'" -c "e some_file.vim"
3641

3742
REM Check the exit code of Vim command
3843
if %ERRORLEVEL% EQU 0 (
@@ -43,11 +48,11 @@ if %ERRORLEVEL% EQU 0 (
4348
exit /b 1
4449
)
4550

46-
REM Check test results
51+
REM REM Check test results
4752
echo MARKDOWN_EXTRAS unit test results:
4853
type results.txt
4954

50-
REM Check for FAIL in results.txt
55+
REM REM Check for FAIL in results.txt
5156
findstr /I "FAIL" results.txt > nul 2>&1
5257
if %ERRORLEVEL% EQU 0 (
5358
echo ERROR: Some test failed.
@@ -57,6 +62,6 @@ if %ERRORLEVEL% EQU 0 (
5762
echo All tests passed.
5863
)
5964

60-
REM Exit script with success
65+
REM REM Exit script with success
6166
del %VIMRC%
6267
exit /b 0

test/run_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ echo "vim9script" > "$VIMRC"
2727
echo "# ---- dummy vimrc file content -----" >> "$VIMRC"
2828
echo "set nocompatible" >> "$VIMRC"
2929
echo "set runtimepath+=.." >> "$VIMRC"
30+
echo "set runtimepath+=../after" >> "$VIMRC"
3031
echo "set autoindent" >> "$VIMRC"
3132
echo "filetype plugin on" >> "$VIMRC"
3233
echo "# -----------------------------------" >> "$VIMRC"

test/test_markdown_extras.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,5 @@ def g:Test_markdown_lists()
122122
# quit!
123123
# edit!
124124

125-
126125
Cleanup_markdown_testfile()
127126
enddef

0 commit comments

Comments
 (0)