Fix resolution of leading-slash links, add link tests (#1108)

Hopefully this solves #1084, "Page links with leading slash lead to a
file in working directory, not a page at the root of the wiki", introduced
in 850aace.

It also adds a set of tests for different kinds of wiki links:

  - api_base_resolve_link.vader
  - link_syntax_markdown.vader
  - link_syntax_vimwiki.vader

Includes some fixes for locally-failing tests, removes a test from
test/map.vader and comments out test/config_vars.vader entirely for the
moment.

Code by : Brennen Bearnes <code@p1k3.com>
This commit is contained in:
Brennen Bearnes
2021-04-06 20:09:37 -06:00
committed by GitHub
parent 618893be00
commit f396e8a494
17 changed files with 484 additions and 124 deletions
+8 -4
View File
@@ -341,18 +341,22 @@
endfunc
function! AssertIfVersion(version, one, two)
" Run Assert only if vim version higth enough
" Run Assert only if vim version is high enough
if v:version < a:version | return | endif
AssertEqual a:one, a:two
endfunction
function! GetHighlightTerm(group, term)
" Get output of `hi group`
"
" From: https://vi.stackexchange.com/a/12294/5026
" Return list ['bold','underline']
" Warning: must be called if version > 704
" Clause
if v:version < 704 | return [] | endif
"
" Warning: must only be called if has("patch-7.4-2008")
" Or rather: If execute() exists - it's not available for all 7.4
" versions.
" https://github.com/vim/vim/commit/79815f1ec77406f2f21a618c053e5793b597db7a
if has('patch-7.4-2008') != 1 | return [] | endif
" Store output of group to variable
let out = execute('hi ' . a:group)