vimwiki/test/command_generate_links.vader
Rane Brown 36faec1de9 Merge tinmarino-dev_vader. Add new vader tests.
Adds tests for the commands:
VimwikiTOC, VimwikiGenerateLinks, VimwikiDiaryGenerateLinks,
VimwikiRebuildTags, VimwikiGenerateTags, VimwikiGoto

Add syntax tests, key mapping tests and table auto format tests.

New helper function in vader setup file.

The default wikis setup in the test vimrc are now mapped to the Docker
containers test user's home directory. The test user does not have
access to write to other locations.
2019-12-14 21:44:19 -07:00

109 lines
2.3 KiB
Plaintext

Include: vader_includes/vader_setup.vader
Execute (Copy Wiki's Resources):
Log "Start: Copy Resources"
call CopyResources()
# 1 VimwikiGenerateLinks
##########################
Execute (New Command):
Log "1. Testing VimwikiGenerateLinks"
set sw=4
AssertEqual 4, &sw
Given (Void):
Execute (Goto markdown resource wiki):
VimwikiIndex 2
AssertEqual $HOME . '/testmarkdown/index.md', expand('%')
Execute (Edit Test file / VimwikiGenerateLinks):
edit $HOME/testmarkdown/Test.md
AssertEqual $HOME . '/testmarkdown/Test.md', expand('%')
AssertEqual 'markdown', vimwiki#vars#get_wikilocal('syntax')
AssertEqual 1, vimwiki#vars#get_bufferlocal('wiki_nr')
VimwikiGenerateLinks
Expect (The links with a header):
# Generated Links
- [Buzz Bozz](buzz_bozz)
- [Test Wiki](index)
Do (Save Test.md && Re-GenerateLinks):
:edit $HOME/testmarkdown/Test.md\<CR>
:set bt=\<CR>
:write %\<CR>
:VimwikiGenerateLinks\<CR>
Expect (The links with a header with file Test):
# Generated Links
- [Generated Links](Test)
- [Buzz Bozz](buzz_bozz)
- [Test Wiki](index)
# 2 VimwikiDiaryGenerateLinks
#############################
Execute (New Command):
Log "2. Testing VimwikiDiaryGenerateLinks TODO"
set sw=4
AssertEqual 4, &sw
Do (Edit diary/2019-12-10):
:edit $HOME/testmarkdown/diary/2019-12-10.md\<CR>
iinformative content\<Esc>
:call WriteMe()\<CR>
Do (Edit and save diary/2019-07-13):
:edit $HOME/testmarkdown/diary/2019-07-13.md\<CR>
i# informative title\<Esc>
:call WriteMe()\<CR>
Do (Edit and save diary/2018-03-01):
:edit $HOME/testmarkdown/diary/2019-03-01.md\<CR>
:call WriteMe()\<CR>
Do (Edit diary.md && GenerateDiaryLinks):
:edit $HOME/testmarkdown/diary/diary.md\<CR>
:VimwikiDiaryGenerateLinks\<CR>
Expect (diary index generated):
# Diary
## 2019
### December
- [2019-12-10](2019-12-10)
### July
- [informative title](2019-07-13)
### March
- [2019-03-01](2019-03-01)
Execute (Clean):
Log "End: Clean"
call system("rm $HOME/testmarkdown/diary/2019-12-10.md")
call system("rm $HOME/testmarkdown/diary/2019-07-13.md")
call system("rm $HOME/testmarkdown/diary/2019-03-01.md")
call system("rm $HOME/testmarkdown/diary/diary.md")
Include: vader_includes/vader_teardown.vader
# vim: sw=2 ft=conf foldmethod=indent foldlevel=30 foldignore=