Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
7594:1ac8a3077973 | 7595:99e93f72ff91 |
---|---|
46 let s:srcdir = expand('%:p:h:h') | 46 let s:srcdir = expand('%:p:h:h') |
47 | 47 |
48 " Support function: get the alloc ID by name. | 48 " Support function: get the alloc ID by name. |
49 function GetAllocId(name) | 49 function GetAllocId(name) |
50 exe 'split ' . s:srcdir . '/alloc.h' | 50 exe 'split ' . s:srcdir . '/alloc.h' |
51 /typedef enum/ | 51 let top = search('typedef enum') |
52 let top = getline('.') | 52 if top == 0 |
53 call add(v:errors, 'typedef not found in alloc.h') | |
54 endif | |
53 let lnum = search('aid_' . a:name . ',') | 55 let lnum = search('aid_' . a:name . ',') |
54 if lnum == 0 | 56 if lnum == 0 |
55 call add(v:errors, 'Alloc ID ' . a:name . ' not defined') | 57 call add(v:errors, 'Alloc ID ' . a:name . ' not defined') |
56 endif | 58 endif |
57 close | 59 close |
58 return lnum - top | 60 return lnum - top - 1 |
59 endfunc | 61 endfunc |
60 | 62 |
61 | 63 |
62 " Source the test script. First grab the file name, in case the script | 64 " Source the test script. First grab the file name, in case the script |
63 " navigates away. | 65 " navigates away. |