1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
Describe Ignoring insertions is some times desired.
Before each
call autopairs#Variables#InitVariables()
end
It should be possible to disable
new | only!
call autopairs#AutoPairsInit()
call autopairs#AutoPairsToggle()
call Expect(b:autopairs_enabled).to_equal(0)
exec "normal i((("
call Expect("").CheckBuff("(((")
call Expect("((()))\<Left>\<left>))").ToMatch("((()))))")
End
It should ignore pair insertion
new | only!
call autopairs#AutoPairsInit()
call autopairs#AutoPairsIgnore()
call Expect(b:AutoPairsIgnoreSingle).to_equal(1)
exec "normal i((("
call Expect("").CheckBuff("((())")
" Another check for balance testing
exec "normal a)"
call Expect("").CheckBuff("((()))")
" And balance/jump test
exec "normal a)"
call Expect("").CheckBuff("((()))")
End
It should ignore space insertion
new | only!
call autopairs#AutoPairsInit()
call Expect("(").ToMatch("()")
call autopairs#AutoPairsIgnore()
exec "normal a "
call Expect("").CheckBuff("( )")
End
It shouldn't break enter
new | only!
call autopairs#AutoPairsInit()
call Expect("(").ToMatch("()")
call autopairs#AutoPairsIgnore()
exec "normal a\<CR>"
" Why does this need to be double-escaped?
call Expect("").CheckBuff("(\\n)")
End
It should try to handle disabling
" I really need to make it redundant to put these in every single
" test... TODO, fix your shit Livi
new | only!
call autopairs#AutoPairsInit()
call autopairs#AutoPairsToggle()
call Expect("(").ToMatch("(")
call Expect(b:autopairs_enabled).to_equal(0)
call Expect(b:AutoPairsIgnoreSingle).to_equal(0)
End
End
|