forked from python-mode/python-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfolding1.vim
More file actions
38 lines (30 loc) · 847 Bytes
/
folding1.vim
File metadata and controls
38 lines (30 loc) · 847 Bytes
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
" Test that the PymodeLintAuto changes a badly formated buffer.
" For safety empty current buffer.
execute "normal! :%d\<CR>"
" Load sample python file.
read ./test_python_sample_code/folding1.py
" Delete the first line (which is not present in the original file) and save
" loaded file.
execute "normal! gg"
execute "normal! dd"
noautocmd write!
set fdm=marker
set fdm=expr
let foldlevels = ['a1', '=', '=', '=', '=', '=', 's1', '=', '=', '=', '0',
\ '>1', '=', '=', '=', '=', '=', '0', '0', '0',]
if len(foldlevels) != line('$')
echoerr 'Unmatching loaded file and foldlevels list.'
endif
let i = 1
for fdl in foldlevels
let calc = pymode#debug#foldingexpr(i)
let stored = fdl
call assert_true(calc == stored)
let i += 1
endfor
" Assert changes.
if len(v:errors) > 0
cquit!
else
quit!
endif