File: AlternativeCRMapTests.vimspec

package info (click to toggle)
vim-autopairs 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 444 kB
  • sloc: makefile: 4
file content (30 lines) | stat: -rw-r--r-- 871 bytes parent folder | download
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
Describe Avoiding SID-based maps should not break <CR>
    Before each
        call autopairs#Variables#InitVariables()
    End
    It should still cause line breaks
        let g:AutoPairsAvoidSIDMaps = 1
        new | only!
        call Expect("func {\<CR>").ToMatch('func {\n\n}')
    End
    It should cooperate with other <cr> maps
        let g:AutoPairsAvoidSIDMaps = 1
        set sw=2
        set et
        new | only!

        fun! g:CRSidRemapCallback()
            let g:TestPassed=1
            return "\n"
        endfun!

        imap <buffer> <CR> <C-r>=g:CRSidRemapCallback()<cr>
        
        unlet b:autopairs_loaded
        call autopairs#AutoPairsTryInit()
        verbose imap <CR>
        call Expect("func {\<CR>").ToMatch('func {\n\n}')
        call Expect('g:TestPassed').to_exist()
        call Expect(g:TestPassed).to_equal(1)
    End
End