vimwiki/test/link_creation.vader

229 lines
3.5 KiB
Plaintext
Raw Normal View History

Include: vader_includes/vader_setup.vader
2019-07-15 05:50:22 +02:00
# 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):
\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home1.md'\<Cr>
Do (Check in_home2):
j\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home2.md'\<Cr>
Do (Check in_tmp):
jj\<Cr>
:AssertEqual expand('%'), '/tmp/in_tmp.md'\<Cr>
# 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):
\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home1.wiki'\<Cr>
Do (Check in_home2):
j\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home2.wiki'\<Cr>
Do (Check in_tmp):
jj\<Cr>
:AssertEqual expand('%'), '/tmp/in_tmp.wiki'\<Cr>
2020-07-22 01:36:14 +02:00
# Link with dot {{{1
####################
Execute (Log):
Log 'Link with dot'
2020-07-22 01:36:14 +02:00
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):
\<Cr>
j\<Cr>
j\<Cr>
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):
\<Cr>\<Cr>
:AssertEqual expand('%:t'), 'part1.part2.part3'\<Cr>
Do (j<Cr><Cr>):
j\<Cr>\<Cr>
:AssertEqual expand('%:t'), 'part1.part2.part3.md'\<Cr>
# Rest {{{1
##########################
Execute (Log):
Log 'And more'
2019-07-15 05:50:22 +02:00
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
2019-07-15 05:50:22 +02:00
Execute (Set syntax to default):
call SetSyntax('default')
Do (Create links default syntax):
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
\<Enter>
j
\<Enter>
j
\<Enter>
j
\<Enter>
2019-07-15 05:50:22 +02:00
Expect (Vimwiki links):
[[test]]
[[www.google.com]]
[[https://www.google.com]]
[[multiple words]]
[[let's]]
[[let]]'s
[[file.wiki]]
[[file.md]]
[[file.mw]]
2019-07-15 05:50:22 +02:00
Execute (Set syntax to markdown):
call SetSyntax('markdown')
Do (Create links markdown syntax):
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
\<Enter>
j
\<Enter>
j
\<Enter>
j
\<Enter>
2019-07-15 05:50:22 +02:00
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)
2019-07-15 05:50:22 +02:00
Execute (Set syntax to mediawiki):
call SetSyntax('media')
2019-07-15 05:50:22 +02:00
Do (Create links mediawiki syntax):
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
v$
\<Enter>
j
\<Enter>
j
\<Enter>
j
\<Enter>
j
\<Enter>
2019-07-15 05:50:22 +02:00
Expect (Mediawiki links):
[[test]]
[[www.google.com]]
[[https://www.google.com]]
[[multiple words]]
[[let's]]
[[let]]'s
[[file.wiki]]
[[file.md]]
[[file.mw]]
2019-07-15 05:50:22 +02:00
Include: vader_includes/vader_teardown.vader
2020-07-22 01:36:14 +02:00
# vim: foldmethod=marker foldlevel=30