Skip to content

Commit 4c3a1dd

Browse files
committed
Added tests for regexes
1 parent 908e68f commit 4c3a1dd

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

after/ftplugin/markdown.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import autoload '../../lib/utils.vim'
77

88
links.GenerateLinksDict()
99

10-
var code_regex = '\v(\\|`)@<!``@!'
10+
export var code_regex = '\v(\\|`)@<!``@!'
1111
# var italic_regex = '\v(\\|\*)@<!\*\*@!'
1212
# The following picks standalone * and the last * of \**
1313
# It excludes escaped * (i.e. \*\*\*, and sequences like ****)
14-
var italic_regex = '\v((\\|\*)@<!|(\\\*)@<=)\*\*@!'
15-
var bold_regex = '\v(\\|\*)@<!\*\*\*@!'
16-
var strikethrough_regex = '\v(\\|\~)@<!\~\~\~@!'
14+
export var italic_regex = '\v((\\|\*)@<!|(\\\*)@<=)\*\*@!'
15+
export var bold_regex = '\v(\\|\*)@<!\*\*\*@!'
16+
export var strikethrough_regex = '\v(\\|\~)@<!\~\~\~@!'
1717

1818
var text_style_dict = {'`': code_regex,
1919
'*': italic_regex,

test/run_tests.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type "%VIMRC%"
3333
echo/
3434

3535
REM Run Vim with the specified configuration and additional commands
36-
SET "TEST_FILES=['test_markdown_extras.vim', 'test_utils.vim']"
36+
SET "TEST_FILES=['test_markdown_extras.vim', 'test_utils.vim', 'test_regex.vim']"
3737
%VIM_CMD% -c "vim9cmd g:TestFiles = %TEST_FILES%" -S "runner.vim"
3838
REM If things go wrong uncomment the following line and see e.g. if the
3939
REM vimrc_for_test is valid, check :messages and so on.

test/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ echo ""
3737
VIM_CMD="$VIM_PRG --clean -u $VIMRC -i NONE --not-a-term"
3838

3939
# Add test files here:
40-
TESTS=('test_markdown_extras.vim' 'test_utils.vim')
40+
TESTS=('test_markdown_extras.vim' 'test_utils.vim' 'test_regex.vim')
4141

4242
# convert bash list to Vim list
4343
TESTS_STRING=$(printf "'%s', " "${TESTS[@]}")

test/runner.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
vim9script
22

33
# The global variable g:TestFiles is a list containing all the tests filenames.
4-
if exists('g:TestFiles') == 0
5-
g:TestFiles = ['test_markdown_extras.vim', 'test_utils.vim']
4+
if !exists('g:TestFiles')
5+
g:TestFiles = ['test_markdown_extras.vim', 'test_utils.vim', 'test_regex.vim']
66
endif
77

88
delete('results.txt')

0 commit comments

Comments
 (0)