Skip to content

Commit 4195f07

Browse files
committed
Added test for ZipList()
1 parent ba8a367 commit 4195f07

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

after/ftplugin/markdown.vim

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

88
links.GenerateLinksDict()
99

10-
if exists('b:mapleader') == 0
11-
b:mapleader = "m"
12-
endif
10+
var code_regex = '\v`@<!``@!'
11+
var italic_regex = '\v\*@<!\*\*@!'
12+
var bold_regex = '\v\*@<!\*\*\*@!'
13+
var strikethrough_regex = '\v\~@<!\~\~\~@!'
14+
15+
var code_dict = {'`': code_regex}
16+
var italic_dict = {'*': italic_regex}
17+
var bold_dict = {'**': bold_regex}
18+
var strikethrough_dict = {'~~': strikethrough_regex}
1319

1420
if exists('g:markdown_extras_config') != 0
1521
&& has_key(g:markdown_extras_config, 'leader')

test/test_utils.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,19 @@ def g:Test_DeleteTextBetweenMarks()
272272
:%bw!
273273
Cleanup_markdown_testfile()
274274
enddef
275+
276+
def g:Test_ZipList()
277+
278+
var list_a = [1, 2, 3, 4]
279+
var list_b = [4, 3, 2, 1]
280+
var expected_value = [[1, 4], [2, 3], [3, 2], [4, 1]]
281+
var actual_value = utils.ZipLists(list_a, list_b)
282+
assert_equal(expected_value, actual_value)
283+
284+
# Test with different lengths
285+
add(list_b, 0)
286+
actual_value = utils.ZipLists(list_a, list_b)
287+
assert_equal(expected_value, actual_value)
288+
289+
quit!
290+
enddef

0 commit comments

Comments
 (0)