Skip to content

Commit 000232f

Browse files
committed
Add tests for logical line text object
1 parent 9b4a338 commit 000232f

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tests/test_procedures_vimscript/textobject.vim

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
set noautoindent
2+
let g:pymode_rope=1
3+
14
" Load sample python file.
25
" With 'def'.
36
execute "normal! idef func1():\<CR> a = 1\<CR>"
@@ -22,6 +25,57 @@ let content=getline('^', '$')
2225
call assert_true(content == ['class Class2():', ' b = 2', '', 'class Class1():', ' a = 1'])
2326

2427

28+
" Clean file.
29+
%delete
30+
31+
" With 'def'.
32+
execute "normal! iprint(\<CR> 1\<CR>)\<CR>"
33+
execute "normal! iprint(\<CR> 2\<CR>)\<CR>"
34+
execute "normal! iprint(\<CR> 3\<CR>)\<CR>"
35+
normal 4ggdV
36+
37+
let content=getline('^', '$')
38+
call assert_true(content == [
39+
\ "print(", " 1", ")",
40+
\ "print(", " 3", ")",
41+
\ ""
42+
\])
43+
44+
45+
" Clean file.
46+
%delete
47+
48+
" With 'def'.
49+
execute "normal! iprint(\<CR> 1\<CR>)\<CR>"
50+
execute "normal! iprint(\<CR> 2\<CR>)\<CR>"
51+
execute "normal! iprint(\<CR> 3\<CR>)\<CR>"
52+
execute "normal! iprint(\<CR> 4\<CR>)\<CR>"
53+
normal 5ggd2V
54+
55+
let content=getline('^', '$')
56+
call assert_true(content == [
57+
\ "print(", " 1", ")",
58+
\ "print(", " 4", ")",
59+
\ ""
60+
\])
61+
62+
" Clean file.
63+
%delete
64+
65+
" With 'def'.
66+
execute "normal! iprint(\<CR> 1\<CR>)\<CR>"
67+
execute "normal! iprint(\<CR> 2\<CR>)\<CR>"
68+
execute "normal! iprint(\<CR> 3\<CR>)\<CR>"
69+
execute "normal! iprint(\<CR> 4\<CR>)\<CR>"
70+
normal 5ggd2V
71+
72+
let content=getline('^', '$')
73+
call assert_true(content == [
74+
\ "print(", " 1", ")",
75+
\ "print(", " 4", ")",
76+
\ ""
77+
\])
78+
2579
if len(v:errors) > 0
2680
cquit!
2781
else

0 commit comments

Comments
 (0)