mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 20:54:31 +08:00
Reorder some tests and add modelines everywhere
This commit is contained in:
@@ -413,3 +413,4 @@ function! s:keys4cr(info, opts) "{{{1
|
|||||||
echom 79
|
echom 79
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -117,3 +117,4 @@ function! DMTest_quotes(setup, typed, expected, ...)
|
|||||||
let sub = 'quote'
|
let sub = 'quote'
|
||||||
return s:do_set(pat, sub, quotes, a:setup, a:typed, a:expected, skip_expr, todo_expr)
|
return s:do_set(pat, sub, quotes, a:setup, a:typed, a:expected, skip_expr, todo_expr)
|
||||||
endfunction
|
endfunction
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -1,79 +1,90 @@
|
|||||||
" function! DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
" call DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
||||||
" - Runs a single test.
|
" - Runs a single test.
|
||||||
" - Add 1 to vimtap#Plan().
|
" - Add 1 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every pair.
|
" - Runs one test for every pair.
|
||||||
" - Add 7 to vimtap#Plan().
|
" - Add 7 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every quote.
|
" - Runs one test for every quote.
|
||||||
" - Add 5 to vimtap#Plan().
|
" - Add 5 to vimtap#Plan().
|
||||||
|
|
||||||
call vimtest#StartTap()
|
call vimtest#StartTap()
|
||||||
call vimtap#Plan(210)
|
|
||||||
|
call vimtap#Plan(189)
|
||||||
|
|
||||||
|
|
||||||
let g:delimitMate_matchpairs = '(:),{:},[:],<:>,¿:?,¡:!,,::'
|
let g:delimitMate_matchpairs = '(:),{:},[:],<:>,¿:?,¡:!,,::'
|
||||||
let g:delimitMate_autoclose = 1
|
let g:delimitMate_autoclose = 1
|
||||||
call DMTest_pairs('', "i(", "()")
|
call DMTest_pairs('', "i(", "()")
|
||||||
|
|
||||||
call DMTest_pairs('()', "a\<BS>", "")
|
call DMTest_pairs('()', "a\<BS>", "")
|
||||||
|
|
||||||
call DMTest_pairs('()', "a)x", "()x")
|
call DMTest_pairs('()', "a)x", "()x")
|
||||||
|
|
||||||
"call DMTest_pairs('', "((\<C-G>gx", "(())x")
|
"call DMTest_pairs('', "((\<C-G>gx", "(())x")
|
||||||
call DMTest_pairs('', "i(x\<Esc>u", "")
|
call DMTest_pairs('', "i(x\<Esc>u", "")
|
||||||
|
|
||||||
call DMTest_pairs('', "i@(x", "@(x)")
|
call DMTest_pairs('', "i@(x", "@(x)")
|
||||||
|
|
||||||
call DMTest_pairs('@#', "a(x", "@(x)#")
|
call DMTest_pairs('@#', "a(x", "@(x)#")
|
||||||
|
|
||||||
call DMTest_pairs('\', "a(x", '\(x')
|
call DMTest_pairs('\', "a(x", '\(x')
|
||||||
|
|
||||||
call DMTest_pairs('(\)', "la)x", '(\)x)')
|
call DMTest_pairs('(\)', "la)x", '(\)x)')
|
||||||
|
|
||||||
"call DMTest_pairs('', "(\<S-Tab>x", "()x")
|
"call DMTest_pairs('', "(\<S-Tab>x", "()x")
|
||||||
let g:delimitMate_autoclose = 0
|
let g:delimitMate_autoclose = 0
|
||||||
call DMTest_pairs('', "i(x", "(x")
|
call DMTest_pairs('', "i(x", "(x")
|
||||||
|
|
||||||
call DMTest_pairs('', "i()x", "(x)")
|
call DMTest_pairs('', "i()x", "(x)")
|
||||||
|
|
||||||
call DMTest_pairs('', "i())x", "()x")
|
call DMTest_pairs('', "i())x", "()x")
|
||||||
|
|
||||||
call DMTest_pairs('', "i()\<BS>x", "x")
|
call DMTest_pairs('', "i()\<BS>x", "x")
|
||||||
|
|
||||||
call DMTest_pairs('', "i@()x", "@(x)")
|
call DMTest_pairs('', "i@()x", "@(x)")
|
||||||
|
|
||||||
call DMTest_pairs('@#', "a()x", "@(x)#")
|
call DMTest_pairs('@#', "a()x", "@(x)#")
|
||||||
let g:delimitMate_expand_space = 1
|
|
||||||
let g:delimitMate_autoclose = 1
|
|
||||||
call DMTest_pairs('', "i(\<Space>x", "( x )")
|
|
||||||
call DMTest_pairs('( )', "2|a\<BS>x", "(x)")
|
|
||||||
call DMTest_pairs('', "iabc x", "abc x")
|
|
||||||
let g:delimitMate_autoclose = 0
|
|
||||||
call DMTest_pairs('', "i()\<Space>\<BS>x", "(x)")
|
|
||||||
let g:delimitMate_autoclose = 1
|
let g:delimitMate_autoclose = 1
|
||||||
" Handle backspace gracefully.
|
" Handle backspace gracefully.
|
||||||
set backspace=
|
set backspace=
|
||||||
call DMTest_pairs('', "i(\<Esc>a\<BS>x", "(x)")
|
call DMTest_pairs('', "i(\<Esc>a\<BS>x", "(x)")
|
||||||
|
|
||||||
set backspace=2
|
set backspace=2
|
||||||
" closing parens removes characters. #133
|
" closing parens removes characters. #133
|
||||||
call DMTest_pairs('(a)', "a)", "()a)")
|
call DMTest_pairs('(a)', "a)", "()a)")
|
||||||
|
|
||||||
" Add semicolon next to the closing paren. Issue #77.
|
|
||||||
"new
|
|
||||||
"let b:delimitMate_eol_marker = ';'
|
|
||||||
"call DMTest_pairs('', "abc(x", "abc(x);")
|
|
||||||
"" BS should behave accordingly.
|
|
||||||
"call DMTest_pairs('', "abc(\<BS>", "abc;")
|
|
||||||
"unlet b:delimitMate_eol_marker
|
|
||||||
" Expand iabbreviations
|
" Expand iabbreviations
|
||||||
iabb def ghi
|
iabb def ghi
|
||||||
" TODO not sure how to make this test actually test if the feature works.
|
call DMTest_pairs('', "idef(", "ghi()")
|
||||||
call DMTest_pairs('', "idef(", "ghi()") ", '', 1)
|
|
||||||
iunabb def
|
iunabb def
|
||||||
|
|
||||||
call DMTest_pairs("abc а", "$i(", "abc (а")
|
call DMTest_pairs("abc а", "$i(", "abc (а")
|
||||||
|
|
||||||
call DMTest_pairs("abc ñ", "$i(", "abc (ñ")
|
call DMTest_pairs("abc ñ", "$i(", "abc (ñ")
|
||||||
|
|
||||||
call DMTest_pairs("abc $", "$i(", "abc ($")
|
call DMTest_pairs("abc $", "$i(", "abc ($")
|
||||||
|
|
||||||
call DMTest_pairs("abc £", "$i(", "abc (£")
|
call DMTest_pairs("abc £", "$i(", "abc (£")
|
||||||
|
|
||||||
call DMTest_pairs("abc d", "$i(", "abc (d")
|
call DMTest_pairs("abc d", "$i(", "abc (d")
|
||||||
|
|
||||||
call DMTest_pairs("abc .", "$i(", "abc ().")
|
call DMTest_pairs("abc .", "$i(", "abc ().")
|
||||||
|
|
||||||
call DMTest_pairs("abc ", "$i(", "abc () ")
|
call DMTest_pairs("abc ", "$i(", "abc () ")
|
||||||
|
|
||||||
call DMTest_pairs("abc (", "$i(", "abc ((")
|
call DMTest_pairs("abc (", "$i(", "abc ((")
|
||||||
|
|
||||||
"" Play nice with undo.
|
" Play nice with undo.
|
||||||
"call DMTest_pairs('', "a\<C-G>u(c)b\<C-O>u", "a")
|
call DMTest_pairs('', "ia\<C-G>u(c)b\<Esc>u", "a")
|
||||||
"
|
|
||||||
let g:delimitMate_autoclose = 1
|
let g:delimitMate_autoclose = 1
|
||||||
let g:delimitMate_balance_pairs = 1
|
let g:delimitMate_balance_pairs = 1
|
||||||
call DMTest_pairs('ab cd)', "2|a(x", 'ab(x cd)')
|
call DMTest_pairs('ab cd)', "la(x", 'ab(x cd)')
|
||||||
|
|
||||||
|
|
||||||
call vimtest#Quit()
|
call vimtest#Quit()
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -1,83 +1,105 @@
|
|||||||
" function! DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
" call DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
||||||
" - Runs a single test.
|
" - Runs a single test.
|
||||||
" - Add 1 to vimtap#Plan().
|
" - Add 1 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every pair.
|
" - Runs one test for every pair.
|
||||||
" - Add 7 to vimtap#Plan().
|
" - Add 7 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every quote.
|
" - Runs one test for every quote.
|
||||||
" - Add 5 to vimtap#Plan().
|
" - Add 5 to vimtap#Plan().
|
||||||
|
|
||||||
call vimtest#StartTap()
|
call vimtest#StartTap()
|
||||||
call vimtap#Plan(170)
|
|
||||||
|
call vimtap#Plan(142)
|
||||||
|
|
||||||
|
|
||||||
let g:delimitMate_autoclose = 1
|
let g:delimitMate_autoclose = 1
|
||||||
call DMTest_quotes('', "i'x", "'x'")
|
call DMTest_quotes('', "i'x", "'x'")
|
||||||
|
|
||||||
call DMTest_quotes('', "i'x\<Esc>u", "")
|
call DMTest_quotes('', "i'x\<Esc>u", "")
|
||||||
|
|
||||||
call DMTest_quotes('', "i''x", "''x")
|
call DMTest_quotes('', "i''x", "''x")
|
||||||
|
|
||||||
call DMTest_quotes("''", "a\<BS>x", "x")
|
call DMTest_quotes("''", "a\<BS>x", "x")
|
||||||
|
|
||||||
"call DMTest_quotes('', "'\<C-G>gx", "''x")
|
"call DMTest_quotes('', "'\<C-G>gx", "''x")
|
||||||
" This will fail for double quote.
|
" This will fail for double quote.
|
||||||
call DMTest_quotes('', "i'\"x", "'\"x\"'", 'a:typed =~ "i\"\"x"')
|
call DMTest_quotes('', "i'\"x", "'\"x\"'", 'a:typed =~ "i\"\"x"')
|
||||||
|
|
||||||
call DMTest_quotes('', "i@'x", "@'x'")
|
call DMTest_quotes('', "i@'x", "@'x'")
|
||||||
|
|
||||||
call DMTest_quotes('@#', "a'x", "@'x'#")
|
call DMTest_quotes('@#', "a'x", "@'x'#")
|
||||||
|
|
||||||
"call DMTest_quotes('', "'\<S-Tab>x", "''x")
|
"call DMTest_quotes('', "'\<S-Tab>x", "''x")
|
||||||
call DMTest_quotes('abc', "A'", "abc'")
|
call DMTest_quotes('abc', "A'", "abc'")
|
||||||
|
|
||||||
call DMTest_quotes('abc\', "A'x", "abc\\'x")
|
call DMTest_quotes('abc\', "A'x", "abc\\'x")
|
||||||
|
|
||||||
call DMTest_quotes('', "au'Привет'", "u'Привет'")
|
call DMTest_quotes('', "au'Привет'", "u'Привет'")
|
||||||
|
|
||||||
call DMTest_quotes('', "au'string'", "u'string'")
|
call DMTest_quotes('', "au'string'", "u'string'")
|
||||||
|
|
||||||
let g:delimitMate_autoclose = 0
|
let g:delimitMate_autoclose = 0
|
||||||
call DMTest_quotes('', "a'x", "'x")
|
call DMTest_quotes('', "a'x", "'x")
|
||||||
|
|
||||||
call DMTest_quotes('', "a''x", "'x'")
|
call DMTest_quotes('', "a''x", "'x'")
|
||||||
|
|
||||||
call DMTest_quotes('', "a'''x", "''x")
|
call DMTest_quotes('', "a'''x", "''x")
|
||||||
|
|
||||||
call DMTest_quotes('', "a''\<BS>x", "x")
|
call DMTest_quotes('', "a''\<BS>x", "x")
|
||||||
|
|
||||||
call DMTest_quotes('', "a@''x", "@'x'")
|
call DMTest_quotes('', "a@''x", "@'x'")
|
||||||
|
|
||||||
call DMTest_quotes('@#', "a''x", "@'x'#")
|
call DMTest_quotes('@#', "a''x", "@'x'#")
|
||||||
let g:delimitMate_autoclose = 1
|
|
||||||
let g:delimitMate_expand_space = 1
|
|
||||||
call DMTest_quotes('', "i' x", "' x'")
|
|
||||||
let g:delimitMate_expand_inside_quotes = 1
|
|
||||||
call DMTest_quotes('', "i' x", "' x '")
|
|
||||||
call DMTest_quotes('', "i' \<BS>x", "'x'")
|
|
||||||
call DMTest_quotes('abc\', "A'' x", "abc\\'' x '")
|
|
||||||
let g:delimitMate_autoclose = 0
|
|
||||||
call DMTest_quotes('', "i'' \<BS>x", "'x'")
|
|
||||||
unlet g:delimitMate_expand_space
|
|
||||||
unlet g:delimitMate_expand_inside_quotes
|
|
||||||
let g:delimitMate_autoclose = 1
|
let g:delimitMate_autoclose = 1
|
||||||
" Handle backspace gracefully.
|
" Handle backspace gracefully.
|
||||||
set backspace=
|
set backspace=
|
||||||
call DMTest_quotes('', "a'\<Esc>a\<BS>x", "'x'")
|
call DMTest_quotes('', "a'\<Esc>a\<BS>x", "'x'")
|
||||||
|
|
||||||
set backspace=2
|
set backspace=2
|
||||||
"set cpo=ces$
|
"set cpo=ces$
|
||||||
"call DMTest_quotes('', "'x", "'x'")
|
"call DMTest_quotes('', "'x", "'x'")
|
||||||
" Make sure smart quote works beyond first column.
|
" Make sure smart quote works beyond first column.
|
||||||
call DMTest_quotes(' ', "a'x", " 'x'")
|
call DMTest_quotes(' ', "a'x", " 'x'")
|
||||||
|
|
||||||
" smart quote, check fo char on the right.
|
" smart quote, check fo char on the right.
|
||||||
call DMTest_quotes('a b', "la'", "a 'b")
|
call DMTest_quotes('a b', "la'", "a 'b")
|
||||||
|
|
||||||
" Make sure we jump over a quote on the right. #89.
|
" Make sure we jump over a quote on the right. #89.
|
||||||
call DMTest_quotes('', "a('test'x", "('test'x)")
|
call DMTest_quotes('', "a('test'x", "('test'x)")
|
||||||
|
|
||||||
" Duplicate whole line when inserting quote at bol #105
|
" Duplicate whole line when inserting quote at bol #105
|
||||||
call DMTest_quotes('}', "i'", "''}")
|
call DMTest_quotes('}', "i'", "''}")
|
||||||
|
|
||||||
call DMTest_quotes("'abc ", "A'", "'abc '")
|
call DMTest_quotes("'abc ", "A'", "'abc '")
|
||||||
|
|
||||||
call DMTest_quotes("''abc ", "A'", "''abc ''")
|
call DMTest_quotes("''abc ", "A'", "''abc ''")
|
||||||
|
|
||||||
" Nesting quotes:
|
" Nesting quotes:
|
||||||
let g:delimitMate_nesting_quotes = delimitMate#option('quotes')
|
let g:delimitMate_nesting_quotes = delimitMate#option('quotes')
|
||||||
call DMTest_quotes("''", "A'x", "'''x'''")
|
call DMTest_quotes("''", "A'x", "'''x'''")
|
||||||
|
|
||||||
call DMTest_quotes("'''", "A'x", "''''x''''")
|
call DMTest_quotes("'''", "A'x", "''''x''''")
|
||||||
|
|
||||||
call DMTest_quotes('', "i''x", "''x")
|
call DMTest_quotes('', "i''x", "''x")
|
||||||
|
|
||||||
call DMTest_quotes('', "i'x", "'x'")
|
call DMTest_quotes('', "i'x", "'x'")
|
||||||
|
|
||||||
unlet g:delimitMate_nesting_quotes
|
unlet g:delimitMate_nesting_quotes
|
||||||
" expand iabbreviations
|
" expand iabbreviations
|
||||||
iabb def ghi
|
iabb def ghi
|
||||||
call DMTest_quotes('', "idef'", "ghi'", 'a:typed =~ "^idef[''`«|]"')
|
call DMTest_single('', 'idef"', 'ghi"')
|
||||||
|
|
||||||
iunabb def
|
iunabb def
|
||||||
""call DMTest_quotes('', "i'\<CR>\<BS>", "''")
|
""call DMTest_quotes('', "i'\<CR>\<BS>", "''")
|
||||||
" Double quote starts a comment in viml
|
" Double quote starts a comment in viml
|
||||||
set ft=vim
|
set ft=vim
|
||||||
call DMTest_single('', 'i"', '"')
|
call DMTest_single('', 'i"', '"')
|
||||||
|
|
||||||
set ft=
|
set ft=
|
||||||
|
|
||||||
call vimtest#Quit()
|
call vimtest#Quit()
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
" function! DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
" call DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
||||||
" - Runs a single test.
|
" - Runs a single test.
|
||||||
" - Add 1 to vimtap#Plan().
|
" - Add 1 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every pair.
|
" - Runs one test for every pair.
|
||||||
" - Add 7 to vimtap#Plan().
|
" - Add 7 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every quote.
|
" - Runs one test for every quote.
|
||||||
" - Add 5 to vimtap#Plan().
|
" - Add 5 to vimtap#Plan().
|
||||||
|
|
||||||
@@ -40,3 +40,4 @@ call DMTest_single('', "i;\<Left>{(\<CR>x", ['{(', 'x', ')};'])
|
|||||||
|
|
||||||
" End: quit vim.
|
" End: quit vim.
|
||||||
call vimtest#Quit()
|
call vimtest#Quit()
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
" function! DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
" call DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
||||||
" - Runs a single test.
|
" - Runs a single test.
|
||||||
" - Add 1 to vimtap#Plan().
|
" - Add 1 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every pair.
|
" - Runs one test for every pair.
|
||||||
" - Add 7 to vimtap#Plan().
|
" - Add 7 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every quote.
|
" - Runs one test for every quote.
|
||||||
" - Add 5 to vimtap#Plan().
|
" - Add 5 to vimtap#Plan().
|
||||||
|
|
||||||
@@ -25,11 +25,13 @@ call DMTest_single('$(document).ready(function() {})',
|
|||||||
" Issue #95
|
" Issue #95
|
||||||
new
|
new
|
||||||
let b:delimitMate_jump_expansion = 1
|
let b:delimitMate_jump_expansion = 1
|
||||||
call DMTest_single('', "i(\<CR>test)x",
|
call DMTest_single('',
|
||||||
|
\ "i(\<CR>test)x",
|
||||||
\ ['(', 'test', ')x'])
|
\ ['(', 'test', ')x'])
|
||||||
|
|
||||||
" Remove CR expansion on BS
|
" Remove CR expansion on BS
|
||||||
call DMTest_single('', "i(\<CR>\<BS>x",
|
call DMTest_single('',
|
||||||
|
\ "i(\<CR>\<BS>x",
|
||||||
\ ['(x)'])
|
\ ['(x)'])
|
||||||
|
|
||||||
" Consider indentation with BS inside an empty CR expansion.
|
" Consider indentation with BS inside an empty CR expansion.
|
||||||
@@ -72,19 +74,26 @@ set foldmethod=marker
|
|||||||
set foldmarker={,}
|
set foldmarker={,}
|
||||||
set foldlevel=0
|
set foldlevel=0
|
||||||
set backspace=2
|
set backspace=2
|
||||||
call DMTest_single('', "iabc {\<CR>x",
|
call DMTest_single('',
|
||||||
\['abc {',
|
\ "iabc {\<CR>x",
|
||||||
\ ' x',
|
\ ['abc {',
|
||||||
\ '}'])
|
\ ' x',
|
||||||
|
\ '}'])
|
||||||
:bp
|
:bp
|
||||||
|
|
||||||
" expand_cr != 2
|
" expand_cr != 2
|
||||||
call DMTest_single('abc(def)', "i\<Esc>$i\<CR>x",
|
call DMTest_single('abc(def)',
|
||||||
|
\ "i\<Esc>$i\<CR>x",
|
||||||
\ ['abc(def',
|
\ ['abc(def',
|
||||||
\ ' x)'])
|
\ ' x)'])
|
||||||
|
|
||||||
" expand_cr == 2
|
" expand_cr == 2
|
||||||
let delimitMate_expand_cr = 2
|
let delimitMate_expand_cr = 2
|
||||||
call DMTest_single('abc(def)', "$i\<CR>x", ['abc(def', ' x', ' )'])
|
call DMTest_single('abc(def)',
|
||||||
|
\ "$i\<CR>x",
|
||||||
|
\ ['abc(def',
|
||||||
|
\ ' x',
|
||||||
|
\ ' )'])
|
||||||
|
|
||||||
" Play nice with smartindent
|
" Play nice with smartindent
|
||||||
set all&
|
set all&
|
||||||
@@ -102,3 +111,4 @@ let delimitMate_expand_inside_quotes = 1
|
|||||||
call DMTest_quotes('', "i'\<CR>x", ["'", "x", "'"])
|
call DMTest_quotes('', "i'\<CR>x", ["'", "x", "'"])
|
||||||
|
|
||||||
call vimtest#Quit()
|
call vimtest#Quit()
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -1,26 +1,46 @@
|
|||||||
" function! DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
" call DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
||||||
" - Runs a single test.
|
" - Runs a single test.
|
||||||
" - Add 1 to vimtap#Plan().
|
" - Add 1 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every pair.
|
" - Runs one test for every pair.
|
||||||
" - Add 7 to vimtap#Plan().
|
" - Add 7 to vimtap#Plan().
|
||||||
"
|
"
|
||||||
" function! DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
" call DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
||||||
" - Runs one test for every quote.
|
" - Runs one test for every quote.
|
||||||
" - Add 5 to vimtap#Plan().
|
" - Add 5 to vimtap#Plan().
|
||||||
|
|
||||||
call vimtest#StartTap()
|
call vimtest#StartTap()
|
||||||
call vimtap#Plan(12)
|
|
||||||
|
call vimtap#Plan(60)
|
||||||
|
|
||||||
|
|
||||||
let g:delimitMate_expand_space = 1
|
let g:delimitMate_expand_space = 1
|
||||||
|
|
||||||
|
let g:delimitMate_autoclose = 1
|
||||||
|
call DMTest_pairs('', "i(\<Space>x", "( x )")
|
||||||
|
|
||||||
|
call DMTest_pairs('( )', "la\<BS>x", "(x)")
|
||||||
|
|
||||||
|
call DMTest_pairs('', "iabc x", "abc x")
|
||||||
|
|
||||||
|
call DMTest_quotes('', "i' x", "' x'")
|
||||||
|
|
||||||
|
let g:delimitMate_expand_inside_quotes = 1
|
||||||
|
call DMTest_quotes('', "i' x", "' x '")
|
||||||
|
|
||||||
|
call DMTest_quotes('', "i' \<BS>x", "'x'")
|
||||||
|
|
||||||
|
call DMTest_quotes('abc\', "A'' x", "abc\\'' x '")
|
||||||
|
|
||||||
" Issue #95
|
" Issue #95
|
||||||
let b:delimitMate_jump_expansion = 1
|
let b:delimitMate_jump_expansion = 1
|
||||||
call DMTest_pairs('', "i( test)x", '( test )x')
|
call DMTest_pairs('', "i( test)x", '( test )x')
|
||||||
|
|
||||||
let delimitMate_expand_inside_quotes = 1
|
let g:delimitMate_autoclose = 0
|
||||||
|
call DMTest_pairs('', "i()\<Space>\<BS>x", "(x)")
|
||||||
|
|
||||||
call DMTest_quotes('', "i' x", "' x '")
|
call DMTest_quotes('', "i'' \<BS>x", "'x'")
|
||||||
|
|
||||||
call vimtest#Quit()
|
call vimtest#Quit()
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
" function! DMTest_single(setup, typed, expected[, skip_expr[, todo_expr]])
|
|
||||||
" - Runs a single test.
|
|
||||||
" - Add 1 to vimtap#Plan().
|
|
||||||
"
|
|
||||||
" function! DMTest_pairs(setup, typed, expected, [skip_expr[, todo_expr]])
|
|
||||||
" - Runs one test for every pair.
|
|
||||||
" - Add 7 to vimtap#Plan().
|
|
||||||
"
|
|
||||||
" function! DMTest_quotes(setup, typed, expected, [skip_expr[, todo_expr]])
|
|
||||||
" - Runs one test for every quote.
|
|
||||||
" - Add 5 to vimtap#Plan().
|
|
||||||
|
|
||||||
call vimtest#StartTap()
|
|
||||||
call vimtap#Plan(1)
|
|
||||||
|
|
||||||
let g:delimitMate_expand_cr = 1
|
|
||||||
let g:delimitMate_eol_marker = ';'
|
|
||||||
DelimitMateReload
|
|
||||||
call vimtap#Like(maparg('(', 'i'), '<Plug>delimitMate(', 'Mappings defined for the first buffer without filetype set.')
|
|
||||||
call vimtest#Quit()
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user