Skip to content

Commit

Permalink
feat: Add g:doge_comment_jump_wrap backwards jumping tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Sep 11, 2019
1 parent 4f1010e commit d2e2abb
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions test/options/doge_comment_jump_wrap.vader
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Given php (PHP function without parameters where g:doge_comment_jump_wrap = 1):
function myFunction() {}

Do (trigger doge):
Do (trigger doge and jump forward):
:let g:doge_comment_jump_wrap = 0\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
Expand All @@ -28,9 +28,31 @@ Expect php (generated comment with a description and @return tag):
*/
function myFunction() {}

# Jump backwards
Do (trigger doge and jump backwards):
:let g:doge_comment_jump_wrap = 0\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
# Trigger 2 <S-Tab> characters.
# The cursor should stay on the first TODO item.
\<S-Tab>
\<S-Tab>

Then (the first TODO item should be selected):
AssertEqual 2, line('.')
AssertEqual 4, col('.')

Expect php (generated comment with a description and @return tag):
/**
* [TODO:description]
*
* @return [TODO:type] [TODO:description]
*/
function myFunction() {}

# ------------------------------------------------------------------------------

Do (trigger doge):
Do (trigger doge and jump forward):
:let g:doge_comment_jump_wrap = 1\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
Expand All @@ -50,6 +72,27 @@ Expect php (generated comment with @param and @return tags):
*/
function myFunction() {}

# Jump backwards
Do (trigger doge and jump backwards):
:let g:doge_comment_jump_wrap = 1\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
\<S-Tab>
\<S-Tab>
\<S-Tab>

Then (the first TODO item should be selected):
AssertEqual 2, line('.')
AssertEqual 4, col('.')

Expect php (generated comment with @param and @return tags):
/**
* [TODO:description]
*
* @return [TODO:type] [TODO:description]
*/
function myFunction() {}

Do (let g:doge_comment_interactive = 0):
# Disable the option again so that upcoming tests will not fail.
:let g:doge_comment_interactive = 0\<CR>

0 comments on commit d2e2abb

Please sign in to comment.