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
|
Describe Auto-break settings
Before each
call autopairs#Variables#InitVariables()
End
It should sync options
let g:AutoPairsSyncAutoBreakOptions = 1
let g:AutoPairsAutoBreakBefore = ['{', '"""']
let g:AutoPairsAutoLineBreak = ['[']
new | only!
call Expect(b:AutoPairsAutoBreakBefore).to_equal(g:AutoPairsAutoLineBreak)
call Expect(b:AutoPairsAutoLineBreak).to_equal(g:AutoPairsAutoLineBreak)
End
It should break before
let g:AutoPairsAutoBreakBefore = ['{']
new | only!
call Expect("func {").ToMatch('func \n{}')
call Expect("func (").ToMatch('func ()') " Control test to make sure not everything gets expanded
End
It should break after
let g:AutoPairsAutoLineBreak = ['{']
new | only!
call Expect("func {").ToMatch('func {\n\n}')
call Expect("func (").ToMatch('func ()')
End
It should break on both with sync
let g:AutoPairsSyncAutoBreakOptions = 1
let g:AutoPairsAutoLineBreak = ['{']
new | only!
call Expect("func {").ToMatch('func \n{\n\n}')
End
It should break on both without sync
let g:AutoPairsAutoLineBreak = ['{']
let g:AutoPairsAutoBreakBefore = ['{']
new | only!
call Expect("func {").ToMatch('func \n{\n\n}')
End
End
|