Test: add issue non-regession and todo list

This commit is contained in:
Tinmarino 2020-06-04 17:29:47 -04:00
parent 5e564bb10d
commit 1617d4b654
3 changed files with 345 additions and 0 deletions

View File

@ -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=

84
test/issue_markdown.vader Normal file
View File

@ -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):
\<CR>
# TODO should be Link.md, revise the test
Expect (Link):
[Link](Link)
Do (<CR><CR>):
\<CR>\<CR>
:AssertEqual expand('%:t'), 'Link.md'\<CR>
Given vimwiki (Link):
Link
Do (No link: <CR><CR>):
:call vimwiki#vars#set_global('markdown_create_link', 0)
\<CR>\<CR>
:AssertEqual expand('%:t'), 'main.md'\<CR>
Include: vader_includes/vader_teardown.vader

235
test/list_todo.vader Normal file
View File

@ -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: <C-Space>):
Gk\<C-Space>
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: <C-Space>):
\<C-Space>
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\<C-Space>
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\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
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\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
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\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
j\<C-Space>
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\<Space>
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<Space>]):
jgL\<Space>
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<C-Space>]):
jvjjj\<C-Space>
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\<C-t>Chap1.1
# Note the tab
Expect (Introduce Chap1.1):
1. [ ] Chap1
1. [ ] Chap1.1
2. [ ] Chap2
Do (Toogle <C-Space>):
\<C-Space>
Expect (Chap1 Done):
1. [X] Chap1
2. [ ] Chap2
Include: vader_includes/vader_teardown.vader