X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/46c859c8a10b9f420cc73087182f0c9a6b272f71..df5d5c5adb5ff6a087e1e837aaaa25e22ba74d70:/test/map.vader?ds=sidebyside diff --git a/test/map.vader b/test/map.vader index 51bde78..ea96182 100644 --- a/test/map.vader +++ b/test/map.vader @@ -4,11 +4,12 @@ a c Execute (gx autolink): let b:url = 'http://b' let b:line = getline(1) - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'a') + 1), '' - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, '<') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'h') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, '>') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'c') + 1), '' + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + AssertEqual b:func(1, match(b:line, 'a') + 1), '' + AssertEqual b:func(1, match(b:line, '<') + 1), b:url + AssertEqual b:func(1, match(b:line, 'h') + 1), b:url + AssertEqual b:func(1, match(b:line, '>') + 1), b:url + AssertEqual b:func(1, match(b:line, 'c') + 1), '' Given mkd; a http://b.bb c @@ -16,9 +17,10 @@ a http://b.bb c Execute (gx implicit autolink): let b:url = 'http://b.bb' let b:line = getline(1) - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'a') + 1), '' - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'h') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'c') + 1), '' + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + AssertEqual b:func(1, match(b:line, 'a') + 1), '' + AssertEqual b:func(1, match(b:line, 'h') + 1), b:url + AssertEqual b:func(1, match(b:line, 'c') + 1), '' Given mkd; [a]: http://b "c" @@ -26,10 +28,11 @@ Given mkd; Execute (gx link reference definition): let b:url = 'http://b' let b:line = getline(1) + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') " TODO would be cool if all of the following gave the link. - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'a') + 1), '' - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'h') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'c') + 1), '' + AssertEqual b:func(1, match(b:line, 'a') + 1), '' + AssertEqual b:func(1, match(b:line, 'h') + 1), b:url + AssertEqual b:func(1, match(b:line, 'c') + 1), '' Given mkd; a [b](c) d @@ -37,14 +40,15 @@ a [b](c) d Execute (gx autolink): let b:url = 'c' let b:line = getline(1) - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'a') + 1), '' - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, '[') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'b') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, ']') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, '(') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'c') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, ')') + 1), b:url - AssertEqual b:Markdown_GetUrlForPosition(1, match(b:line, 'd') + 1), '' + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + AssertEqual b:func(1, match(b:line, 'a') + 1), '' + AssertEqual b:func(1, match(b:line, '[') + 1), b:url + AssertEqual b:func(1, match(b:line, 'b') + 1), b:url + AssertEqual b:func(1, match(b:line, ']') + 1), b:url + AssertEqual b:func(1, match(b:line, '(') + 1), b:url + AssertEqual b:func(1, match(b:line, 'c') + 1), b:url + AssertEqual b:func(1, match(b:line, ')') + 1), b:url + AssertEqual b:func(1, match(b:line, 'd') + 1), '' Given mkd; # a