1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
Before:
find **/lorem-converted.md
normal! gg
Execute (Valid peek, from single reference link on line, [2]):
call cursor(6, 12)
let expected = 'link.vim: http://www.magna.com'
let out = execute('LinkPeek')
let last_mes = split(out, "\n")[-1]
AssertEqual expected, last_mes
Execute (Valid peek, from multiple reference links on line, [5]):
call cursor(9, 15)
let expected = 'link.vim: http://nunc.com'
let out = execute('LinkPeek')
let last_mes = split(out, "\n")[-1]
AssertEqual expected, last_mes
Execute (Invalid peek, from below heading):
call cursor(23, 1)
let out = execute('LinkPeek')
let expected = 'link.vim: Can only peek reference links'
let last_mes = split(out, "\n")[-1]
AssertEqual expected, last_mes
Execute (Invalid peek, label [9] not found in reference section):
call cursor(16, 49)
let out = execute('LinkPeek')
let expected = 'link.vim: Could not locate reference'
let first_mes = split(out, "\n")[0]
AssertEqual expected, first_mes
Execute (Peek of internal link, pointing to existing Markdown file):
call cursor(17, 30)
let out = execute('LinkPeek')
let expected = 'link.vim: lorem-converted.md'
let first_mes = split(out, "\n")[0]
AssertEqual expected, first_mes
Execute (Peek of internal link, pointing to non-existent Markdown file):
call cursor(17, 60)
let out = execute('LinkPeek')
let expected = 'link.vim: Could not resolve link'
let first_mes = split(out, "\n")[0]
AssertEqual expected, first_mes
|