diff src/testdir/runtest.vim @ 7595:99e93f72ff91 v7.4.1097

commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 15 20:53:38 2016 +0100 patch 7.4.1097 Problem: Looking up the alloc ID for tests fails. Solution: Fix the line computation. Use assert_fails() for unlet test.
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jan 2016 21:00:07 +0100
parents 4c922651fd78
children 2720952e9acb
line wrap: on
line diff
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -48,14 +48,16 @@ let s:srcdir = expand('%:p:h:h')
 " Support function: get the alloc ID by name.
 function GetAllocId(name)
   exe 'split ' . s:srcdir . '/alloc.h'
-  /typedef enum/
-  let top = getline('.')
+  let top = search('typedef enum')
+  if top == 0
+    call add(v:errors, 'typedef not found in alloc.h')
+  endif
   let lnum = search('aid_' . a:name . ',')
   if lnum == 0
     call add(v:errors, 'Alloc ID ' . a:name . ' not defined')
   endif
   close
-  return lnum - top
+  return lnum - top - 1
 endfunc