diff --git a/src/testdir/test_goto.vim b/src/testdir/test_goto.vim
index c0235b1..c00e4e4 100644
--- a/src/testdir/test_goto.vim
+++ b/src/testdir/test_goto.vim
@@ -15,262 +15,282 @@
 endfunc
 
 func Test_gD()
-  let lines = [
-	\ 'int x;',
-	\ '',
-	\ 'int func(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int x;
+
+  int func(void)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 1, 5)
 endfunc
 
 func Test_gD_too()
-  let lines = [
-	\ 'Filename x;',
-	\ '',
-	\ 'int Filename',
-	\ 'int func() {',
-	\ '  Filename x;',
-	\ '  return x;',
-	\ ]
+  let lines =<< trim [CODE]
+  Filename x;
+
+  int Filename
+  int func() {
+    Filename x;
+    return x;
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 1, 10)
 endfunc
 
 func Test_gD_comment()
-  let lines = [
-	\ '/* int x; */',
-	\ 'int x;',
-	\ '',
-	\ 'int func(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  /* int x; */
+  int x;
+
+  int func(void)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 2, 5)
 endfunc
 
 func Test_gD_inline_comment()
-  let lines = [
-	\ 'int y /* , x */;',
-	\ 'int x;',
-	\ '',
-	\ 'int func(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int y /* , x */;
+  int x;
+
+  int func(void)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 2, 5)
 endfunc
 
 func Test_gD_string()
-  let lines = [
-	\ 'char *s[] = "x";',
-	\ 'int x = 1;',
-	\ '',
-	\ 'int func(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  char *s[] = "x";
+  int x = 1;
+
+  int func(void)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 2, 5)
 endfunc
 
 func Test_gD_string_same_line()
-  let lines = [
-	\ 'char *s[] = "x", int x = 1;',
-	\ '',
-	\ 'int func(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  char *s[] = "x", int x = 1;
+
+  int func(void)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 1, 22)
 endfunc
 
 func Test_gD_char()
-  let lines = [
-	\ "char c = 'x';",
-	\ 'int x = 1;',
-	\ '',
-	\ 'int func(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  char c = 'x';
+  int x = 1;
+
+  int func(void)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gD', lines, 2, 5)
 endfunc
 
 func Test_gd()
-  let lines = [
-	\ 'int x;',
-	\ '',
-	\ 'int func(int x)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int x;
+
+  int func(int x)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 3, 14)
 endfunc
 
 func Test_gd_not_local()
-  let lines = [
-	\ 'int func1(void)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ '',
-	\ 'int func2(int x)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func1(void)
+  {
+    return x;
+  }
+
+  int func2(int x)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 3, 10)
 endfunc
 
 func Test_gd_kr_style()
-  let lines = [
-	\ 'int func(x)',
-	\ '  int x;',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(x)
+    int x;
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 2, 7)
 endfunc
 
 func Test_gd_missing_braces()
-  let lines = [
-	\ 'def func1(a)',
-	\ '  a + 1',
-	\ 'end',
-	\ '',
-	\ 'a = 1',
-	\ '',
-	\ 'def func2()',
-	\ '  return a',
-	\ 'end',
-	\ ]
+  let lines =<< trim [CODE]
+  def func1(a)
+    a + 1
+  end
+
+  a = 1
+
+  def func2()
+    return a
+  end
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 1, 11)
 endfunc
 
 func Test_gd_comment()
-  let lines = [
-	\ 'int func(void)',
-	\ '{',
-	\ '  /* int x; */',
-	\ '  int x;',
-	\ '  return x;',
-	\ '}',
-	\]
+  let lines =<< trim [CODE]
+  int func(void)
+  {
+    /* int x; */
+    int x;
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 4, 7)
 endfunc
 
 func Test_gd_comment_in_string()
-  let lines = [
-	\ 'int func(void)',
-	\ '{',
-	\ '  char *s ="//"; int x;',
-	\ '  int x;',
-	\ '  return x;',
-	\ '}',
-	\]
+  let lines =<< trim [CODE]
+  int func(void)
+  {
+    char *s ="//"; int x;
+    int x;
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 3, 22)
 endfunc
 
 func Test_gd_string_in_comment()
   set comments=
-  let lines = [
-	\ 'int func(void)',
-	\ '{',
-	\ '  /* " */ int x;',
-	\ '  int x;',
-	\ '  return x;',
-	\ '}',
-	\]
+  let lines =<< trim [CODE]
+  int func(void)
+  {
+    /* " */ int x;
+    int x;
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 3, 15)
   set comments&
 endfunc
 
 func Test_gd_inline_comment()
-  let lines = [
-	\ 'int func(/* x is an int */ int x)',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(/* x is an int */ int x)
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 1, 32)
 endfunc
 
 func Test_gd_inline_comment_only()
-  let lines = [
-	\ 'int func(void) /* one lonely x */',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(void) /* one lonely x */
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 3, 10)
 endfunc
 
 func Test_gd_inline_comment_body()
-  let lines = [
-	\ 'int func(void)',
-	\ '{',
-	\ '  int y /* , x */;',
-	\ '',
-	\ '  for (/* int x = 0 */; y < 2; y++);',
-	\ '',
-	\ '  int x = 0;',
-	\ '',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  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)
 endfunc
 
 func Test_gd_trailing_multiline_comment()
-  let lines = [
-	\ 'int func(int x) /* x is an int */',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(int x) /* x is an int */
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 1, 14)
 endfunc
 
 func Test_gd_trailing_comment()
-  let lines = [
-	\ 'int func(int x) // x is an int',
-	\ '{',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(int x) // x is an int
+  {
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 1, 14)
 endfunc
 
 func Test_gd_string()
-  let lines = [
-	\ 'int func(void)',
-	\ '{',
-	\ '  char *s = "x";',
-	\ '  int x = 1;',
-	\ '',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(void)
+  {
+    char *s = "x";
+    int x = 1;
+
+    return x;
+  }
+  [CODE]
   call XTest_goto_decl('gd', lines, 4, 7)
 endfunc
 
 func Test_gd_string_only()
-  let lines = [
-	\ 'int func(void)',
-	\ '{',
-	\ '  char *s = "x";',
-	\ '',
-	\ '  return x;',
-	\ '}',
-	\ ]
+  let lines =<< trim [CODE]
+  int func(void)
+  {
+    char *s = "x";
+
+    return x;
+  }
+  [CODE]
+
   call XTest_goto_decl('gd', lines, 5, 10)
 endfunc
 
@@ -289,24 +309,25 @@
 endfunc
 
 func Test_gd_local_block()
-  let lines = [
-	\ '  int main()',
-	\ '{',
-	\ '  char *a = "NOT NULL";',
-	\ '  if(a)',
-	\ '  {',
-	\ '    char *b = a;',
-	\ '    printf("%s\n", b);',
-	\ '  }',
-	\ '  else',
-	\ '  {',
-	\ '    char *b = "NULL";',
-	\ '    return b;',
-	\ '  }',
-	\ '',
-	\ '  return 0;',
-	\ '}',
-  \ ]
+  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;
+    }
+
+    return 0;
+  }
+  [CODE]
+
   call XTest_goto_decl('1gd', lines, 11, 11)
 endfunc
 
