Include: vader_includes/vader_setup.vader # Visual Creatin {{{1 # Issues: #382 #################### Execute (Log): Log 'Visual Creation' # For markdown {{{2 # ------------------ Given vimwiki (abc def ghi jkl): abc def ghi jkl Execute (Set filename wiki_test.md): Log '>> Visual creation, markdown syntax' file wiki_test.md call SetSyntax('markdown') AssertEqual vimwiki#vars#get_wikilocal('syntax'), 'markdown' Do (v3e): v3e\ Expect (3 Words []()): [abc def ghi](abc def ghi) jkl Do (v3e): wv2e\ Expect (2 Words []()): abc [def ghi](def ghi) jkl Do (selection=exclusive v3e): :set selection=exclusive\ wv2e\ Expect (2 Words []()): abc [def ghi](def ghi) jkl Do (selection=exclusive wv$): :set selection=exclusive\ wv$\ Expect (3 Words []()): abc [def ghi jkl](def ghi jkl) # For Wiki {{{2 # ------------------ Given vimwiki (abc def ghi jkl): abc def ghi jkl Execute (Set filename wiki_test.md): Log '>> Visual creation, wiki syntax' file wiki_test.wiki call SetSyntax('default') Do (v3e): v3e\ Expect (3 Words []()): [[abc def ghi]] jkl Do (v3e): wv2e\ Expect (2 Words []()): abc [[def ghi]] jkl Do (selection=exclusive v3e): :set selection=exclusive\ wv2e\ Expect (2 Words []()): abc [[def ghi]] jkl Do (selection=exclusive wv$): :set selection=exclusive\ wv$\ Expect (3 Words []()): abc [[def ghi jkl]] # Absolute links {{{1 #################### Execute (Log): Log 'Absolute links' # For markdown {{{2 # ------------------ Execute (Set filename wiki_test.md): Log '>> Absolute link, markdown syntax' file wiki_test.md call SetSyntax('markdown') Given vimwiki(some wiki link): [test1](//$HOME/in_home1) [test2](//~/in_home2) [test3](///tmp/in_tmp) Do (Check in_home1): \ :AssertEqual expand('%'), $HOME.'/in_home1.md'\ Do (Check in_home2): j\ :AssertEqual expand('%'), $HOME.'/in_home2.md'\ Do (Check in_tmp): jj\ :AssertEqual expand('%'), '/tmp/in_tmp.md'\ # For Wiki {{{2 # ------------------ Execute (Set filename wiki_test.wiki): Log '>> Absolute link, wiki syntax' file wiki_test.wiki call SetSyntax('default') Given vimwiki(some wiki link): [[//$HOME/in_home1]] [[//~/in_home2]] [[///tmp/in_tmp]] Do (Check in_home1): \ :AssertEqual expand('%'), $HOME.'/in_home1.wiki'\ Do (Check in_home2): j\ :AssertEqual expand('%'), $HOME.'/in_home2.wiki'\ Do (Check in_tmp): jj\ :AssertEqual expand('%'), '/tmp/in_tmp.wiki'\ # Link with dot {{{1 #################### Execute (Log): Log 'Link with dot' Given vimwiki (filnames with dots): part1.part2.part3 part1.part2.part3.md noext Execute (Set filename wiki_test.md): file wiki_test.md call SetSyntax('markdown') Do (Linkify all): \ j\ j\ Expect (Full Words are made as links, no extension addded . -> space): [part1 part2 part3](part1.part2.part3) [part1 part2 part3](part1.part2.part3.md) [noext](noext) Given vimwiki (filnames with dots): part1.part2.part3 part1.part2.part3.md noext Do (Fllow link witout markdown): \\ :AssertEqual expand('%:t'), 'part1.part2.part3'\ Do (j): j\\ :AssertEqual expand('%:t'), 'part1.part2.part3.md'\ # Rest {{{1 ########################## Execute (Log): Log 'And more' Given vimwiki (Text that is not a wikilink): test www.google.com https://www.google.com multiple words let's let's file.wiki file.md file.mw Execute (Set syntax to default): call SetSyntax('default') Do (Create links default syntax): \ j v$ \ j v$ \ j v$ \ j v$ \ j \ j \ j \ j \ Expect (Vimwiki links): [[test]] [[www.google.com]] [[https://www.google.com]] [[multiple words]] [[let's]] [[let]]'s [[file.wiki]] [[file.md]] [[file.mw]] Execute (Set syntax to markdown): call SetSyntax('markdown') Do (Create links markdown syntax): \ j v$ \ j v$ \ j v$ \ j v$ \ j \ j \ j \ j \ Expect (Markdown links): [test](test) [www.google.com](www.google.com) [https://www.google.com](https://www.google.com) [multiple words](multiple words) [let's](let's) [let](let)'s [file wiki](file.wiki) [file](file.md) [file mw](file.mw) Execute (Set syntax to mediawiki): call SetSyntax('media') Do (Create links mediawiki syntax): \ j v$ \ j v$ \ j v$ \ j v$ \ j \ j \ j \ j \ Expect (Mediawiki links): [[test]] [[www.google.com]] [[https://www.google.com]] [[multiple words]] [[let's]] [[let]]'s [[file.wiki]] [[file.md]] [[file.mw]] Include: vader_includes/vader_teardown.vader # vim: foldmethod=marker foldlevel=30