diff --git a/test/command_toc.vader b/test/command_toc.vader index 0c3be5c..b738ce9 100644 --- a/test/command_toc.vader +++ b/test/command_toc.vader @@ -144,6 +144,32 @@ Expect (Brand new TOC with sommaire): ### Header 2.1.1 +Execute (call vimwiki#vars#set_global('toc_header_level', 6): + call vimwiki#vars#set_global('toc_header_level', 6) + VimwikiTOC +# Reset default + call vimwiki#vars#set_global('toc_header_level', 1) + +Expect (Content prepended): + ###### Sommaire + + - [Header 1](#Header 1) + - [Header 1.1](#Header 1#Header 1.1) + - [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1) + - [Header 2](#Header 2) + - [Header 2.1.1](#Header 2#Header 2.1.1) + + # Header 1 + random text + ## Header 1.1 + random text + ### Header 1.1.1 + random text + + # Header 2 + ### Header 2.1.1 + + Include: vader_includes/vader_teardown.vader " vim: sw=2 foldmethod=indent foldlevel=30 foldignore= diff --git a/test/issue_markdown.vader b/test/issue_markdown.vader new file mode 100644 index 0000000..3bb8671 --- /dev/null +++ b/test/issue_markdown.vader @@ -0,0 +1,84 @@ +# Non regression tests for issues, see changelog +# In reverse chronological order +# +# Thanks to all contributors with issues and pull request on github +# + + +Include: vader_includes/vader_setup.vader + + +# #735 Fix off-by-one error in get_next_line and get_prev_line +Given vimwiki (P#735 -> I#407): + 1. item1 + 2. item2 + ``` + echo "hello world" + ``` + 3. item3 + +Do (o): + o + +Expect (Renumber all): + 1. item1 + 2. + 3. item2 + ``` + echo "hello world" + ``` + 4. item3 + + +# TODO move to option +# #899 conceallevel is setted globally when editing a wiki file +Given vimwiki (Void): + +Execute (conceal): +# First conceal 2 + set conceallevel=1 + let g:vimwiki_global_vars['conceallevel']=2 + call SetSyntax('markdown') + file main.md + edit + AssertEqual &ft, 'vimwiki' + AssertEqual @%, 'main.md' + if exists('+conceallevel') + AssertEqual &conceallevel, 2 + endif +# Second New conceal 0 +# let g:vimwiki_global_vars['conceallevel']=0 +# edit new.md +# AssertEqual &ft, 'vimwiki' +# AssertEqual @%, 'new.md' +# if exists('+conceallevel') +# AssertEqual &conceallevel, 0 +# endif +# bd! + + +# PR #528: Add option |g:vimwiki_create_link| to prevent link creation +Given vimwiki (Link): + Link + +Do (Enter): + \ + +# TODO should be Link.md, revise the test +Expect (Link): + [Link](Link) + +Do (): + \\ + :AssertEqual expand('%:t'), 'Link.md'\ + +Given vimwiki (Link): + Link + +Do (No link: ): + :call vimwiki#vars#set_global('markdown_create_link', 0) + \\ + :AssertEqual expand('%:t'), 'main.md'\ + + +Include: vader_includes/vader_teardown.vader diff --git a/test/list_todo.vader b/test/list_todo.vader new file mode 100644 index 0000000..b996b79 --- /dev/null +++ b/test/list_todo.vader @@ -0,0 +1,235 @@ +Include: vader_includes/vader_setup.vader + +Given vimwiki (Todo list): + * [ ] Chap1 + * [ ] Section1.1 + * [ ] Section1.2 + * [ ] Section1.3 + * [ ] Section1.4 + * [ ] Section1.5 + * [ ] Section1.6 + * [ ] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [X] Chap2 + End + +Execute (Set syntax markdown): + call SetSyntax('markdown') + +Do (Toogle Chap2: ): + Gk\ + +Expect (Toogle Chap2): + * [ ] Chap1 + * [ ] Section1.1 + * [ ] Section1.2 + * [ ] Section1.3 + * [ ] Section1.4 + * [ ] Section1.5 + * [ ] Section1.6 + * [ ] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [ ] Chap2 + End + +Do (Toogle Chap1: ): + \ + +Expect (Remove nested [ ] -> [X]): + * [X] Chap1 + * [X] Section1.1 + * [X] Section1.2 + * [X] Section1.3 + * [X] Section1.4 + * [X] Section1.5 + * [X] Section1.6 + * [X] Section1.7 + * [X] Section1.8 + * [X] Section1.9 + * [X] Section1.10 + * [X] Chap2 + End + +Do (Toogle sub 1): + j\ + +Expect (Completing [ ] -> [.]): + * [.] Chap1 + * [X] Section1.1 + * [ ] Section1.2 + * [ ] Section1.3 + * [ ] Section1.4 + * [ ] Section1.5 + * [ ] Section1.6 + * [ ] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [X] Chap2 + End + +Do (Toogle sub4): + j\ + j\ + j\ + j\ + +Expect (Completing [ ] -> [.]): + * [o] Chap1 + * [X] Section1.1 + * [X] Section1.2 + * [X] Section1.3 + * [X] Section1.4 + * [ ] Section1.5 + * [ ] Section1.6 + * [ ] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [X] Chap2 + End + +Do (Toogle sub7): + j\ + j\ + j\ + j\ + j\ + j\ + j\ + +Expect (Completing [ ] -> [.]): + * [O] Chap1 + * [X] Section1.1 + * [X] Section1.2 + * [X] Section1.3 + * [X] Section1.4 + * [X] Section1.5 + * [X] Section1.6 + * [X] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [X] Chap2 + End + +Do (Toogle sub10): + j\ + j\ + j\ + j\ + j\ + j\ + j\ + j\ + j\ + j\ + +Expect (Completing [ ] -> [.]): + * [X] Chap1 + * [X] Section1.1 + * [X] Section1.2 + * [X] Section1.3 + * [X] Section1.4 + * [X] Section1.5 + * [X] Section1.6 + * [X] Section1.7 + * [X] Section1.8 + * [X] Section1.9 + * [X] Section1.10 + * [X] Chap2 + End + +Do (Toogle delete todo box [gl]): + gl\ + +Expect (Chap1 no checkbox): + * Chap1 + * [ ] Section1.1 + * [ ] Section1.2 + * [ ] Section1.3 + * [ ] Section1.4 + * [ ] Section1.5 + * [ ] Section1.6 + * [ ] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [X] Chap2 + End + +Do (Toogle delete todo boxes [gL]): + jgL\ + +Expect (Chap1.x no checkbox): + * [ ] Chap1 + * Section1.1 + * Section1.2 + * Section1.3 + * Section1.4 + * Section1.5 + * Section1.6 + * Section1.7 + * Section1.8 + * Section1.9 + * Section1.10 + * [X] Chap2 + End + +Do (Visual toogl [v]): + jvjjj\ + + +Expect (4 items toogled): + * [o] Chap1 + * [X] Section1.1 + * [X] Section1.2 + * [X] Section1.3 + * [X] Section1.4 + * [ ] Section1.5 + * [ ] Section1.6 + * [ ] Section1.7 + * [ ] Section1.8 + * [ ] Section1.9 + * [ ] Section1.10 + * [X] Chap2 + End + +################################################################################ +# Numbered Todo list + +Given vimwiki (Number TODO list): + 1. [ ] Chap1 + 2. [ ] Chap2 + +Do (Go): + Go + +# Note the space at the end of 3 +Expect (Introduce new Number todo item): + 1. [ ] Chap1 + 2. [ ] Chap2 + 3. [ ] + +Do (New item and ident): + o\Chap1.1 + +# Note the tab +Expect (Introduce Chap1.1): + 1. [ ] Chap1 + 1. [ ] Chap1.1 + 2. [ ] Chap2 + +Do (Toogle ): + \ + +Expect (Chap1 Done): + 1. [X] Chap1 + 2. [ ] Chap2 + + +Include: vader_includes/vader_teardown.vader