aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-10-19 15:23:14 -0700
committerGitHub <noreply@github.com>2019-10-19 15:23:14 -0700
commit06a6828f01638d7f1fed012b494d93eb5f1c206d (patch)
tree3af4c60ce6701ddcdb434c0d31fbb0c6596db2f3 /src/nvim/testdir
parent93fe30593b47fe98a31c6bb67f4d6effb8b725fe (diff)
parent76f548a4765a95ee728ec65b84b8032170b483eb (diff)
downloadrneovim-06a6828f01638d7f1fed012b494d93eb5f1c206d.tar.gz
rneovim-06a6828f01638d7f1fed012b494d93eb5f1c206d.tar.bz2
rneovim-06a6828f01638d7f1fed012b494d93eb5f1c206d.zip
Merge #11211 from jbradaric/vim-8.1.1585
vim-patch:8.1.{1585,1625,1723,1729}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cindent.vim56
-rw-r--r--src/nvim/testdir/test_debugger.vim56
-rw-r--r--src/nvim/testdir/test_goto.vim288
-rw-r--r--src/nvim/testdir/test_let.vim53
-rw-r--r--src/nvim/testdir/test_mksession_utf8.vim36
-rw-r--r--src/nvim/testdir/test_normal.vim180
-rw-r--r--src/nvim/testdir/test_popup.vim11
-rw-r--r--src/nvim/testdir/test_profile.vim12
-rw-r--r--src/nvim/testdir/test_quickfix.vim152
-rw-r--r--src/nvim/testdir/test_vimscript.vim70
10 files changed, 510 insertions, 404 deletions
diff --git a/src/nvim/testdir/test_cindent.vim b/src/nvim/testdir/test_cindent.vim
index f979e354ba..d9795d9335 100644
--- a/src/nvim/testdir/test_cindent.vim
+++ b/src/nvim/testdir/test_cindent.vim
@@ -19,23 +19,23 @@ func Test_cino_extern_c()
" Test for cino-E
let without_ind =<< trim [CODE]
- #ifdef __cplusplus
- extern "C" {
- #endif
- int func_a(void);
- #ifdef __cplusplus
- }
- #endif
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ int func_a(void);
+ #ifdef __cplusplus
+ }
+ #endif
[CODE]
let with_ind =<< trim [CODE]
- #ifdef __cplusplus
- extern "C" {
- #endif
- int func_a(void);
- #ifdef __cplusplus
- }
- #endif
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ int func_a(void);
+ #ifdef __cplusplus
+ }
+ #endif
[CODE]
new
setlocal cindent cinoptions=E0
@@ -90,30 +90,30 @@ func Test_cindent_expr()
endfunc
setl expandtab sw=8 indentkeys+=; indentexpr=MyIndentFunction()
let testinput =<< trim [CODE]
- var_a = something()
- b = something()
+ var_a = something()
+ b = something()
[CODE]
call setline(1, testinput)
call cursor(1, 1)
call feedkeys("^\<c-v>j$A;\<esc>", 'tnix')
- let expected =<< trim [CODE]
- var_a = something();
- b = something();
- [CODE]
+ let expected =<< [CODE]
+ var_a = something();
+b = something();
+[CODE]
call assert_equal(expected, getline(1, '$'))
%d
- let testinput =<< trim [CODE]
- var_a = something()
- b = something()
- [CODE]
+ let testinput =<< [CODE]
+ var_a = something()
+ b = something()
+[CODE]
call setline(1, testinput)
call cursor(1, 1)
call feedkeys("^\<c-v>j$A;\<esc>", 'tnix')
- let expected =<< trim [CODE]
- var_a = something();
- b = something()
- [CODE]
+ let expected =<< [CODE]
+ var_a = something();
+ b = something()
+[CODE]
call assert_equal(expected, getline(1, '$'))
bw!
endfunc
diff --git a/src/nvim/testdir/test_debugger.vim b/src/nvim/testdir/test_debugger.vim
index 3ef460b4fe..130bcf8910 100644
--- a/src/nvim/testdir/test_debugger.vim
+++ b/src/nvim/testdir/test_debugger.vim
@@ -26,27 +26,29 @@ func Test_Debugger()
endif
" Create a Vim script with some functions
- call writefile([
- \ 'func Foo()',
- \ ' let var1 = 1',
- \ ' let var2 = Bar(var1) + 9',
- \ ' return var2',
- \ 'endfunc',
- \ 'func Bar(var)',
- \ ' let var1 = 2 + a:var',
- \ ' let var2 = Bazz(var1) + 4',
- \ ' return var2',
- \ 'endfunc',
- \ 'func Bazz(var)',
- \ ' try',
- \ ' let var1 = 3 + a:var',
- \ ' let var3 = "another var"',
- \ ' let var3 = "value2"',
- \ ' catch',
- \ ' let var4 = "exception"',
- \ ' endtry',
- \ ' return var1',
- \ 'endfunc'], 'Xtest.vim')
+ let lines =<< trim END
+ func Foo()
+ let var1 = 1
+ let var2 = Bar(var1) + 9
+ return var2
+ endfunc
+ func Bar(var)
+ let var1 = 2 + a:var
+ let var2 = Bazz(var1) + 4
+ return var2
+ endfunc
+ func Bazz(var)
+ try
+ let var1 = 3 + a:var
+ let var3 = "another var"
+ let var3 = "value2"
+ catch
+ let var4 = "exception"
+ endtry
+ return var1
+ endfunc
+ END
+ call writefile(lines, 'Xtest.vim')
" Start Vim in a terminal
let buf = RunVimInTerminal('-S Xtest.vim', {})
@@ -294,11 +296,13 @@ func Test_Debugger()
" Tests for :breakadd file and :breakadd here
" Breakpoints should be set before sourcing the file
- call writefile([
- \ 'let var1 = 10',
- \ 'let var2 = 20',
- \ 'let var3 = 30',
- \ 'let var4 = 40'], 'Xtest.vim')
+ let lines =<< trim END
+ let var1 = 10
+ let var2 = 20
+ let var3 = 30
+ let var4 = 40
+ END
+ call writefile(lines, 'Xtest.vim')
" Start Vim in a terminal
let buf = RunVimInTerminal('Xtest.vim', {})
diff --git a/src/nvim/testdir/test_goto.vim b/src/nvim/testdir/test_goto.vim
index f04a5a7e3d..19513b315a 100644
--- a/src/nvim/testdir/test_goto.vim
+++ b/src/nvim/testdir/test_goto.vim
@@ -16,12 +16,12 @@ endfunc
func Test_gD()
let lines =<< trim [CODE]
- int x;
-
- int func(void)
- {
- return x;
- }
+ int x;
+
+ int func(void)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gD', lines, 1, 5)
@@ -29,12 +29,12 @@ endfunc
func Test_gD_too()
let lines =<< trim [CODE]
- Filename x;
-
- int Filename
- int func() {
Filename x;
- return x;
+
+ int Filename
+ int func() {
+ Filename x;
+ return x;
[CODE]
call XTest_goto_decl('gD', lines, 1, 10)
@@ -42,13 +42,13 @@ endfunc
func Test_gD_comment()
let lines =<< trim [CODE]
- /* int x; */
- int x;
-
- int func(void)
- {
- return x;
- }
+ /* int x; */
+ int x;
+
+ int func(void)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gD', lines, 2, 5)
@@ -56,13 +56,13 @@ endfunc
func Test_gD_inline_comment()
let lines =<< trim [CODE]
- int y /* , x */;
- int x;
-
- int func(void)
- {
- return x;
- }
+ int y /* , x */;
+ int x;
+
+ int func(void)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gD', lines, 2, 5)
@@ -70,13 +70,13 @@ endfunc
func Test_gD_string()
let lines =<< trim [CODE]
- char *s[] = "x";
- int x = 1;
-
- int func(void)
- {
- return x;
- }
+ char *s[] = "x";
+ int x = 1;
+
+ int func(void)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gD', lines, 2, 5)
@@ -84,12 +84,12 @@ endfunc
func Test_gD_string_same_line()
let lines =<< trim [CODE]
- char *s[] = "x", int x = 1;
-
- int func(void)
- {
- return x;
- }
+ char *s[] = "x", int x = 1;
+
+ int func(void)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gD', lines, 1, 22)
@@ -97,13 +97,13 @@ endfunc
func Test_gD_char()
let lines =<< trim [CODE]
- char c = 'x';
- int x = 1;
-
- int func(void)
- {
- return x;
- }
+ char c = 'x';
+ int x = 1;
+
+ int func(void)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gD', lines, 2, 5)
@@ -111,12 +111,12 @@ endfunc
func Test_gd()
let lines =<< trim [CODE]
- int x;
-
- int func(int x)
- {
- return x;
- }
+ int x;
+
+ int func(int x)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 3, 14)
@@ -124,15 +124,15 @@ endfunc
func Test_gd_not_local()
let lines =<< trim [CODE]
- int func1(void)
- {
- return x;
- }
-
- int func2(int x)
- {
- return x;
- }
+ int func1(void)
+ {
+ return x;
+ }
+
+ int func2(int x)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 3, 10)
@@ -140,11 +140,11 @@ endfunc
func Test_gd_kr_style()
let lines =<< trim [CODE]
- int func(x)
- int x;
- {
- return x;
- }
+ int func(x)
+ int x;
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 2, 7)
@@ -152,15 +152,15 @@ endfunc
func Test_gd_missing_braces()
let lines =<< trim [CODE]
- def func1(a)
- a + 1
- end
-
- a = 1
-
- def func2()
- return a
- end
+ def func1(a)
+ a + 1
+ end
+
+ a = 1
+
+ def func2()
+ return a
+ end
[CODE]
call XTest_goto_decl('gd', lines, 1, 11)
@@ -168,12 +168,12 @@ endfunc
func Test_gd_comment()
let lines =<< trim [CODE]
- int func(void)
- {
- /* int x; */
- int x;
- return x;
- }
+ int func(void)
+ {
+ /* int x; */
+ int x;
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 4, 7)
@@ -181,12 +181,12 @@ endfunc
func Test_gd_comment_in_string()
let lines =<< trim [CODE]
- int func(void)
- {
- char *s ="//"; int x;
- int x;
- return x;
- }
+ int func(void)
+ {
+ char *s ="//"; int x;
+ int x;
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 3, 22)
@@ -195,12 +195,12 @@ endfunc
func Test_gd_string_in_comment()
set comments=
let lines =<< trim [CODE]
- int func(void)
- {
- /* " */ int x;
- int x;
- return x;
- }
+ int func(void)
+ {
+ /* " */ int x;
+ int x;
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 3, 15)
@@ -209,10 +209,10 @@ endfunc
func Test_gd_inline_comment()
let lines =<< trim [CODE]
- int func(/* x is an int */ int x)
- {
- return x;
- }
+ int func(/* x is an int */ int x)
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 1, 32)
@@ -220,10 +220,10 @@ endfunc
func Test_gd_inline_comment_only()
let lines =<< trim [CODE]
- int func(void) /* one lonely x */
- {
- return x;
- }
+ int func(void) /* one lonely x */
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 3, 10)
@@ -231,16 +231,16 @@ endfunc
func Test_gd_inline_comment_body()
let lines =<< trim [CODE]
- int func(void)
- {
- int y /* , x */;
-
- for (/* int x = 0 */; y < 2; y++);
-
- int x = 0;
-
- return x;
- }
+ int func(void)
+ {
+ int y /* , x */;
+
+ for (/* int x = 0 */; y < 2; y++);
+
+ int x = 0;
+
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 7, 7)
@@ -248,10 +248,10 @@ endfunc
func Test_gd_trailing_multiline_comment()
let lines =<< trim [CODE]
- int func(int x) /* x is an int */
- {
- return x;
- }
+ int func(int x) /* x is an int */
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 1, 14)
@@ -259,10 +259,10 @@ endfunc
func Test_gd_trailing_comment()
let lines =<< trim [CODE]
- int func(int x) // x is an int
- {
- return x;
- }
+ int func(int x) // x is an int
+ {
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 1, 14)
@@ -270,13 +270,13 @@ endfunc
func Test_gd_string()
let lines =<< trim [CODE]
- int func(void)
- {
- char *s = "x";
- int x = 1;
-
- return x;
- }
+ int func(void)
+ {
+ char *s = "x";
+ int x = 1;
+
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 4, 7)
@@ -284,12 +284,12 @@ endfunc
func Test_gd_string_only()
let lines =<< trim [CODE]
- int func(void)
- {
- char *s = "x";
-
- return x;
- }
+ int func(void)
+ {
+ char *s = "x";
+
+ return x;
+ }
[CODE]
call XTest_goto_decl('gd', lines, 5, 10)
@@ -312,21 +312,21 @@ endfunc
func Test_gd_local_block()
let lines =<< trim [CODE]
int main()
- {
- char *a = "NOT NULL";
- if(a)
- {
- char *b = a;
- printf("%s\n", b);
- }
- else
{
- char *b = "NULL";
- return b;
+ char *a = "NOT NULL";
+ if(a)
+ {
+ char *b = a;
+ printf("%s\n", b);
+ }
+ else
+ {
+ char *b = "NULL";
+ return b;
+ }
+
+ return 0;
}
-
- return 0;
- }
[CODE]
call XTest_goto_decl('1gd', lines, 11, 11)
diff --git a/src/nvim/testdir/test_let.vim b/src/nvim/testdir/test_let.vim
index 43f35e2b9d..b5af871ab2 100644
--- a/src/nvim/testdir/test_let.vim
+++ b/src/nvim/testdir/test_let.vim
@@ -153,14 +153,37 @@ func Test_let_heredoc_fails()
call assert_fails('source XheredocFail', 'E126:')
call delete('XheredocFail')
- let text =<< trim END
+ let text =<< trim CodeEnd
func MissingEnd()
let v =<< END
endfunc
- END
+ CodeEnd
call writefile(text, 'XheredocWrong')
call assert_fails('source XheredocWrong', 'E126:')
call delete('XheredocWrong')
+
+ let text =<< trim TEXTend
+ let v =<< " comment
+ TEXTend
+ call writefile(text, 'XheredocNoMarker')
+ call assert_fails('source XheredocNoMarker', 'E172:')
+ call delete('XheredocNoMarker')
+
+ let text =<< trim TEXTend
+ let v =<< text
+ TEXTend
+ call writefile(text, 'XheredocBadMarker')
+ call assert_fails('source XheredocBadMarker', 'E221:')
+ call delete('XheredocBadMarker')
+endfunc
+
+func Test_let_heredoc_trim_no_indent_marker()
+ let text =<< trim END
+ Text
+ with
+ indent
+END
+ call assert_equal(['Text', 'with', 'indent'], text)
endfunc
" Test for the setting a variable using the heredoc syntax
@@ -173,9 +196,9 @@ END
call assert_equal(["Some sample text", "\tText with indent", " !@#$%^&*()-+_={}|[]\\~`:\";'<>?,./"], var1)
- let var2 =<<
+ let var2 =<< XXX
Editor
-.
+XXX
call assert_equal(['Editor'], var2)
let var3 =<<END
@@ -199,10 +222,18 @@ END
END
call assert_equal(['Line1', ' Line2', "\tLine3", ' END'], var1)
- let var1 =<< trim
+ let var1 =<< trim !!!
+ Line1
+ line2
+ Line3
+ !!!
+ !!!
+ call assert_equal(['Line1', ' line2', "\tLine3", '!!!',], var1)
+
+ let var1 =<< trim XX
Line1
- .
- call assert_equal([' Line1'], var1)
+ XX
+ call assert_equal(['Line1'], var1)
" ignore "endfunc"
let var1 =<< END
@@ -233,16 +264,16 @@ END
call assert_equal(['something', 'python << xx'], var1)
" ignore "append"
- let var1 =<<
+ let var1 =<< E
something
app
-.
+E
call assert_equal(['something', 'app'], var1)
" ignore "append" with trim
- let var1 =<< trim
+ let var1 =<< trim END
something
app
- .
+ END
call assert_equal(['something', 'app'], var1)
endfunc
diff --git a/src/nvim/testdir/test_mksession_utf8.vim b/src/nvim/testdir/test_mksession_utf8.vim
index 36f07512a8..722fd28beb 100644
--- a/src/nvim/testdir/test_mksession_utf8.vim
+++ b/src/nvim/testdir/test_mksession_utf8.vim
@@ -66,32 +66,32 @@ func Test_mksession_utf8()
mksession! test_mks.out
let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
let expected =<< trim [DATA]
- normal! 016|
- normal! 016|
- normal! 016|
- normal! 08|
- normal! 08|
- normal! 016|
- normal! 016|
- normal! 016|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
- exe 'normal! ' . s:c . '|zs' . 8 . '|'
normal! 08|
- exe 'normal! ' . s:c . '|zs' . 8 . '|'
normal! 08|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
- normal! 016|
- exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 8 . '|'
+ normal! 08|
+ exe 'normal! ' . s:c . '|zs' . 8 . '|'
+ normal! 08|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
+ exe 'normal! ' . s:c . '|zs' . 16 . '|'
+ normal! 016|
[DATA]
call assert_equal(expected, li)
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index aeae6423d0..07d250cace 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -1564,34 +1564,34 @@ endfunc
fun! Test_normal29_brace()
" basic test for { and } movements
let text =<< trim [DATA]
- A paragraph begins after each empty line, and also at each of a set of
- paragraph macros, specified by the pairs of characters in the 'paragraphs'
- option. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to
- the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in
- the first column). A section boundary is also a paragraph boundary.
- Note that a blank line (only containing white space) is NOT a paragraph
- boundary.
-
-
- Also note that this does not include a '{' or '}' in the first column. When
- the '{' flag is in 'cpoptions' then '{' in the first column is used as a
- paragraph boundary |posix|.
- {
- This is no paragraph
- unless the '{' is set
- in 'cpoptions'
- }
- .IP
- The nroff macros IP separates a paragraph
- That means, it must be a '.'
- followed by IP
- .LPIt does not matter, if afterwards some
- more characters follow.
- .SHAlso section boundaries from the nroff
- macros terminate a paragraph. That means
- a character like this:
- .NH
- End of text here
+ A paragraph begins after each empty line, and also at each of a set of
+ paragraph macros, specified by the pairs of characters in the 'paragraphs'
+ option. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to
+ the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in
+ the first column). A section boundary is also a paragraph boundary.
+ Note that a blank line (only containing white space) is NOT a paragraph
+ boundary.
+
+
+ Also note that this does not include a '{' or '}' in the first column. When
+ the '{' flag is in 'cpoptions' then '{' in the first column is used as a
+ paragraph boundary |posix|.
+ {
+ This is no paragraph
+ unless the '{' is set
+ in 'cpoptions'
+ }
+ .IP
+ The nroff macros IP separates a paragraph
+ That means, it must be a '.'
+ followed by IP
+ .LPIt does not matter, if afterwards some
+ more characters follow.
+ .SHAlso section boundaries from the nroff
+ macros terminate a paragraph. That means
+ a character like this:
+ .NH
+ End of text here
[DATA]
new
@@ -1600,17 +1600,17 @@ fun! Test_normal29_brace()
norm! 0d2}
let expected =<< trim [DATA]
- .IP
- The nroff macros IP separates a paragraph
- That means, it must be a '.'
- followed by IP
- .LPIt does not matter, if afterwards some
- more characters follow.
- .SHAlso section boundaries from the nroff
- macros terminate a paragraph. That means
- a character like this:
- .NH
- End of text here
+ .IP
+ The nroff macros IP separates a paragraph
+ That means, it must be a '.'
+ followed by IP
+ .LPIt does not matter, if afterwards some
+ more characters follow.
+ .SHAlso section boundaries from the nroff
+ macros terminate a paragraph. That means
+ a character like this:
+ .NH
+ End of text here
[DATA]
call assert_equal(expected, getline(1, '$'))
@@ -1618,13 +1618,13 @@ fun! Test_normal29_brace()
norm! 0d}
let expected =<< trim [DATA]
- .LPIt does not matter, if afterwards some
- more characters follow.
- .SHAlso section boundaries from the nroff
- macros terminate a paragraph. That means
- a character like this:
- .NH
- End of text here
+ .LPIt does not matter, if afterwards some
+ more characters follow.
+ .SHAlso section boundaries from the nroff
+ macros terminate a paragraph. That means
+ a character like this:
+ .NH
+ End of text here
[DATA]
call assert_equal(expected, getline(1, '$'))
@@ -1633,11 +1633,11 @@ fun! Test_normal29_brace()
norm! d{
let expected =<< trim [DATA]
- .LPIt does not matter, if afterwards some
- more characters follow.
- .SHAlso section boundaries from the nroff
- macros terminate a paragraph. That means
- a character like this:
+ .LPIt does not matter, if afterwards some
+ more characters follow.
+ .SHAlso section boundaries from the nroff
+ macros terminate a paragraph. That means
+ a character like this:
[DATA]
call assert_equal(expected, getline(1, '$'))
@@ -1645,8 +1645,8 @@ fun! Test_normal29_brace()
norm! d{
let expected =<< trim [DATA]
- .LPIt does not matter, if afterwards some
- more characters follow.
+ .LPIt does not matter, if afterwards some
+ more characters follow.
[DATA]
call assert_equal(expected, getline(1, '$'))
@@ -1659,22 +1659,22 @@ fun! Test_normal29_brace()
" 1
" norm! 0d2}
" let expected =<< trim [DATA]
- " {
- " This is no paragraph
- " unless the '{' is set
- " in 'cpoptions'
- " }
- " .IP
- " The nroff macros IP separates a paragraph
- " That means, it must be a '.'
- " followed by IP
- " .LPIt does not matter, if afterwards some
- " more characters follow.
- " .SHAlso section boundaries from the nroff
- " macros terminate a paragraph. That means
- " a character like this:
- " .NH
- " End of text here
+ " {
+ " This is no paragraph
+ " unless the '{' is set
+ " in 'cpoptions'
+ " }
+ " .IP
+ " The nroff macros IP separates a paragraph
+ " That means, it must be a '.'
+ " followed by IP
+ " .LPIt does not matter, if afterwards some
+ " more characters follow.
+ " .SHAlso section boundaries from the nroff
+ " macros terminate a paragraph. That means
+ " a character like this:
+ " .NH
+ " End of text here
"
" [DATA]
" call assert_equal(expected, getline(1, '$'))
@@ -1682,22 +1682,22 @@ fun! Test_normal29_brace()
" $
" norm! d}
" let expected =<< trim [DATA]
- " {
- " This is no paragraph
- " unless the '{' is set
- " in 'cpoptions'
- " }
- " .IP
- " The nroff macros IP separates a paragraph
- " That means, it must be a '.'
- " followed by IP
- " .LPIt does not matter, if afterwards some
- " more characters follow.
- " .SHAlso section boundaries from the nroff
- " macros terminate a paragraph. That means
- " a character like this:
- " .NH
- " End of text here
+ " {
+ " This is no paragraph
+ " unless the '{' is set
+ " in 'cpoptions'
+ " }
+ " .IP
+ " The nroff macros IP separates a paragraph
+ " That means, it must be a '.'
+ " followed by IP
+ " .LPIt does not matter, if afterwards some
+ " more characters follow.
+ " .SHAlso section boundaries from the nroff
+ " macros terminate a paragraph. That means
+ " a character like this:
+ " .NH
+ " End of text here
"
" [DATA]
" call assert_equal(expected, getline(1, '$'))
@@ -1706,11 +1706,11 @@ fun! Test_normal29_brace()
" norm! d5}
"
" let expected =<< trim [DATA]
- " {
- " This is no paragraph
- " unless the '{' is set
- " in 'cpoptions'
- " }
+ " {
+ " This is no paragraph
+ " unless the '{' is set
+ " in 'cpoptions'
+ " }
" [DATA]
" call assert_equal(expected, getline(1, '$'))
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index c63269e5d2..8083672808 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -737,11 +737,12 @@ func Test_popup_position()
if !CanRunVimInTerminal()
return
endif
- call writefile([
- \ '123456789_123456789_123456789_a',
- \ '123456789_123456789_123456789_b',
- \ ' 123',
- \ ], 'Xtest')
+ let lines =<< trim END
+ 123456789_123456789_123456789_a
+ 123456789_123456789_123456789_b
+ 123
+ END
+ call writefile(lines, 'Xtest')
let buf = RunVimInTerminal('Xtest', {})
call term_sendkeys(buf, ":vsplit\<CR>")
diff --git a/src/nvim/testdir/test_profile.vim b/src/nvim/testdir/test_profile.vim
index 4ab20a9c77..f3eb88abf0 100644
--- a/src/nvim/testdir/test_profile.vim
+++ b/src/nvim/testdir/test_profile.vim
@@ -312,13 +312,13 @@ endfunc
func Test_profile_file()
let lines =<< trim [CODE]
- func! Foo()
- endfunc
- for i in range(10)
- " a comment
+ func! Foo()
+ endfunc
+ for i in range(10)
+ " a comment
+ call Foo()
+ endfor
call Foo()
- endfor
- call Foo()
[CODE]
call writefile(lines, 'Xprofile_file.vim')
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index b9a22aff51..fc514fc9e6 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -776,67 +776,67 @@ func Test_efm1()
endif
let l =<< trim [DATA]
- "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
- "Xtestfile", line 6 col 19; this is an error
- gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
- Xtestfile:9: parse error before `asd'
- make: *** [vim] Error 1
- in file "Xtestfile" linenr 10: there is an error
-
- 2 returned
- "Xtestfile", line 11 col 1; this is an error
- "Xtestfile", line 12 col 2; this is another error
- "Xtestfile", line 14:10; this is an error in column 10
- =Xtestfile=, line 15:10; this is another error, but in vcol 10 this time
- "Xtestfile", linenr 16: yet another problem
- Error in "Xtestfile" at line 17:
- x should be a dot
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
- ^
- Error in "Xtestfile" at line 18:
- x should be a dot
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
- .............^
- Error in "Xtestfile" at line 19:
- x should be a dot
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
- --------------^
- Error in "Xtestfile" at line 20:
- x should be a dot
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
- ^
-
- Does anyone know what is the problem and how to correction it?
- "Xtestfile", line 21 col 9: What is the title of the quickfix window?
- "Xtestfile", line 22 col 9: What is the title of the quickfix window?
+ "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
+ "Xtestfile", line 6 col 19; this is an error
+ gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
+ Xtestfile:9: parse error before `asd'
+ make: *** [vim] Error 1
+ in file "Xtestfile" linenr 10: there is an error
+
+ 2 returned
+ "Xtestfile", line 11 col 1; this is an error
+ "Xtestfile", line 12 col 2; this is another error
+ "Xtestfile", line 14:10; this is an error in column 10
+ =Xtestfile=, line 15:10; this is another error, but in vcol 10 this time
+ "Xtestfile", linenr 16: yet another problem
+ Error in "Xtestfile" at line 17:
+ x should be a dot
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
+ ^
+ Error in "Xtestfile" at line 18:
+ x should be a dot
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
+ .............^
+ Error in "Xtestfile" at line 19:
+ x should be a dot
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
+ --------------^
+ Error in "Xtestfile" at line 20:
+ x should be a dot
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
+ ^
+
+ Does anyone know what is the problem and how to correction it?
+ "Xtestfile", line 21 col 9: What is the title of the quickfix window?
+ "Xtestfile", line 22 col 9: What is the title of the quickfix window?
[DATA]
call writefile(l, 'Xerrorfile1')
call writefile(l[:-2], 'Xerrorfile2')
- let m =<< trim [DATA]
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22
- [DATA]
+ let m =<< [DATA]
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22
+[DATA]
call writefile(m, 'Xtestfile')
let save_efm = &efm
@@ -1053,20 +1053,20 @@ func Test_efm2()
" Test for %P, %Q and %t format specifiers
let lines =<< trim [DATA]
- [Xtestfile1]
- (1,17) error: ';' missing
- (21,2) warning: variable 'z' not defined
- (67,3) error: end of file found before string ended
- --
-
- [Xtestfile2]
- --
-
- [Xtestfile3]
- NEW compiler v1.1
- (2,2) warning: variable 'x' not defined
- (67,3) warning: 's' already defined
- -
+ [Xtestfile1]
+ (1,17) error: ';' missing
+ (21,2) warning: variable 'z' not defined
+ (67,3) error: end of file found before string ended
+ --
+
+ [Xtestfile2]
+ --
+
+ [Xtestfile3]
+ NEW compiler v1.1
+ (2,2) warning: variable 'x' not defined
+ (67,3) warning: 's' already defined
+ --
[DATA]
set efm=%+P[%f]%r,(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%+Q--%r
" To exercise the push/pop file functionality in quickfix, the test files
@@ -1090,10 +1090,10 @@ func Test_efm2()
" Tests for %E, %C and %Z format specifiers
let lines =<< trim [DATA]
- Error 275
- line 42
- column 3
- ' ' expected after '--'
+ Error 275
+ line 42
+ column 3
+ ' ' expected after '--'
[DATA]
set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
@@ -1107,8 +1107,8 @@ func Test_efm2()
" Test for %>
let lines =<< trim [DATA]
- Error in line 147 of foo.c:
- unknown variable 'i'
+ Error in line 147 of foo.c:
+ unknown variable 'i'
[DATA]
set efm=unknown\ variable\ %m,%E%>Error\ in\ line\ %l\ of\ %f:,%Z%m
diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim
index f39e53d6dd..3fcba4134e 100644
--- a/src/nvim/testdir/test_vimscript.vim
+++ b/src/nvim/testdir/test_vimscript.vim
@@ -1409,6 +1409,76 @@ func Test_compound_assignment_operators()
let @/ = ''
endfunc
+func Test_function_defined_line()
+ if has('gui_running')
+ " Can't catch the output of gvim.
+ return
+ endif
+
+ let lines =<< trim [CODE]
+ " F1
+ func F1()
+ " F2
+ func F2()
+ "
+ "
+ "
+ return
+ endfunc
+ " F3
+ execute "func F3()\n\n\n\nreturn\nendfunc"
+ " F4
+ execute "func F4()\n
+ \\n
+ \\n
+ \\n
+ \return\n
+ \endfunc"
+ endfunc
+ " F5
+ execute "func F5()\n\n\n\nreturn\nendfunc"
+ " F6
+ execute "func F6()\n
+ \\n
+ \\n
+ \\n
+ \return\n
+ \endfunc"
+ call F1()
+ verbose func F1
+ verbose func F2
+ verbose func F3
+ verbose func F4
+ verbose func F5
+ verbose func F6
+ qall!
+ [CODE]
+
+ call writefile(lines, 'Xtest.vim')
+ let res = system(v:progpath .. ' --clean -es -X -S Xtest.vim')
+ call assert_equal(0, v:shell_error)
+
+ let m = matchstr(res, 'function F1()[^[:print:]]*[[:print:]]*')
+ call assert_match(' line 2$', m)
+
+ let m = matchstr(res, 'function F2()[^[:print:]]*[[:print:]]*')
+ call assert_match(' line 4$', m)
+
+ let m = matchstr(res, 'function F3()[^[:print:]]*[[:print:]]*')
+ call assert_match(' line 11$', m)
+
+ let m = matchstr(res, 'function F4()[^[:print:]]*[[:print:]]*')
+ call assert_match(' line 13$', m)
+
+ let m = matchstr(res, 'function F5()[^[:print:]]*[[:print:]]*')
+ call assert_match(' line 21$', m)
+
+ let m = matchstr(res, 'function F6()[^[:print:]]*[[:print:]]*')
+ call assert_match(' line 23$', m)
+
+ call delete('Xtest.vim')
+endfunc
+
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=4 tw=80 fdm=marker