summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cindent.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-24 00:58:07 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-24 00:58:07 +0200
commite7eb92708ec2092a2fc11e78703b5dcf83844412 (patch)
treed00da20838b81404557c7b0ef17d2890f18175ac /src/testdir/test_cindent.vim
parent0a1f56fcfe31be929e9cd8c3d81a984c960e4180 (diff)
patch 8.1.1585: :let-heredoc does not trim enoughv8.1.1585
Problem: :let-heredoc does not trim enough. Solution: Trim indent from the contents based on the indent of the first line. Use let-heredoc in more tests.
Diffstat (limited to 'src/testdir/test_cindent.vim')
-rw-r--r--src/testdir/test_cindent.vim114
1 files changed, 57 insertions, 57 deletions
diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim
index a813c6cbec..a8a2345577 100644
--- a/src/testdir/test_cindent.vim
+++ b/src/testdir/test_cindent.vim
@@ -18,23 +18,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
@@ -89,30 +89,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
@@ -2069,14 +2069,14 @@ func Test_cindent_2()
let &wm = &columns - 20
let code =<< trim [CODE]
- {
-
- /* this is
- * a real serious important big
- * comment
- */
- /* insert " about life, the universe, and the rest" after "serious" */
- }
+ {
+
+ /* this is
+ * a real serious important big
+ * comment
+ */
+ /* insert " about life, the universe, and the rest" after "serious" */
+ }
[CODE]
call append(0, code)
@@ -3243,32 +3243,32 @@ func Test_cindent_30()
setl cindent ts=4 sw=4
setl cino=+20
- let code =<< trim [CODE]
- void
- foo()
- {
- if (a)
- {
- } else
- asdf;
- }
- [CODE]
+ let code =<< [CODE]
+ void
+foo()
+{
+ if (a)
+ {
+ } else
+ asdf;
+}
+[CODE]
call append(0, code)
normal gg
normal ]]=][
- let expected =<< trim [CODE]
- void
- foo()
- {
- if (a)
- {
- } else
- asdf;
- }
+ let expected =<< [CODE]
+ void
+foo()
+{
+ if (a)
+ {
+ } else
+ asdf;
+}
- [CODE]
+[CODE]
call assert_equal(expected, getline(1, '$'))
enew! | close
@@ -3461,7 +3461,7 @@ func Test_cindent_34()
normal =][
let expected =<< trim [CODE]
-
+
void
func(int a
#if defined(FOO)