X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/5b201ad45474cb0363118682efa7e9a414d5e106..c4975a40eca842dfb11cb3e9aa938451146c9f1d:/test/map.vader?ds=inline diff --git a/test/map.vader b/test/map.vader index 0153269..51bde78 100644 --- a/test/map.vader +++ b/test/map.vader @@ -1,3 +1,51 @@ +Given mkd; +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), '' + +Given mkd; +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), '' + +Given mkd; +[a]: http://b "c" + +Execute (gx link reference definition): + let b:url = 'http://b' + let b:line = getline(1) + " 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), '' + +Given mkd; +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), '' + Given mkd; # a @@ -60,3 +108,16 @@ Execute (]c): AssertEqual line('.'), 3 normal ]c AssertEqual line('.'), 1 + +Given mkd; +# a + +Execute (Toc does not set nomodifiable on other files): + " Sanity check. + Assert &modifiable + + :Toc + :lclose + :edit a + + Assert &modifiable