cd4315a
To: vim-dev@vim.org
cd4315a
Subject: patch 7.1.120
cd4315a
Fcc: outbox
cd4315a
From: Bram Moolenaar <Bram@moolenaar.net>
cd4315a
Mime-Version: 1.0
cd4315a
Content-Type: text/plain; charset=ISO-8859-1
cd4315a
Content-Transfer-Encoding: 8bit
cd4315a
------------
cd4315a
cd4315a
Patch 7.1.120
cd4315a
Problem:    Can't properly check memory leaks while running tests.
cd4315a
Solution:   Add an argument to garbagecollect().  Delete functions and
cd4315a
	    variables in the test scripts.
cd4315a
Files:	    runtime/doc/eval.txt, src/eval.c, src/globals.h, src/main.c,
cd4315a
	    src/testdir/Makefile, src/testdir/test14.in,
cd4315a
	    src/testdir/test26.in, src/testdir/test34.in,
cd4315a
	    src/testdir/test45.in, src/testdir/test47.in,
cd4315a
	    src/testdir/test49.in, src/testdir/test55.in,
cd4315a
	    src/testdir/test56.in, src/testdir/test58.in,
cd4315a
	    src/testdir/test59.in, src/testdir/test60.in,
cd4315a
	    src/testdir/test60.vim, src/testdir/test62.in,
cd4315a
	    src/testdir/test63.in, src/testdir/test64.in
cd4315a
cd4315a
cd4315a
*** ../vim-7.1.119/runtime/doc/eval.txt	Thu Jul 26 22:55:11 2007
cd4315a
--- runtime/doc/eval.txt	Tue Sep 25 17:40:30 2007
cd4315a
***************
cd4315a
*** 1,4 ****
cd4315a
! *eval.txt*      For Vim version 7.1.  Last change: 2007 Jul 25
cd4315a
  
cd4315a
  
cd4315a
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
cd4315a
--- 1,4 ----
cd4315a
! *eval.txt*      For Vim version 7.1.  Last change: 2007 Sep 25
cd4315a
  
cd4315a
  
cd4315a
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
cd4315a
***************
cd4315a
*** 1603,1609 ****
cd4315a
  foldtextresult( {lnum})		String	text for closed fold at {lnum}
cd4315a
  foreground( )			Number	bring the Vim window to the foreground
cd4315a
  function( {name})		Funcref reference to function {name}
cd4315a
! garbagecollect()		none	free memory, breaking cyclic references
cd4315a
  get( {list}, {idx} [, {def}])	any	get item {idx} from {list} or {def}
cd4315a
  get( {dict}, {key} [, {def}])	any	get item {key} from {dict} or {def}
cd4315a
  getbufline( {expr}, {lnum} [, {end}])
cd4315a
--- 1603,1609 ----
cd4315a
  foldtextresult( {lnum})		String	text for closed fold at {lnum}
cd4315a
  foreground( )			Number	bring the Vim window to the foreground
cd4315a
  function( {name})		Funcref reference to function {name}
cd4315a
! garbagecollect( [at_exit])	none	free memory, breaking cyclic references
cd4315a
  get( {list}, {idx} [, {def}])	any	get item {idx} from {list} or {def}
cd4315a
  get( {dict}, {key} [, {def}])	any	get item {key} from {dict} or {def}
cd4315a
  getbufline( {expr}, {lnum} [, {end}])
cd4315a
***************
cd4315a
*** 2673,2679 ****
cd4315a
  		{name} can be a user defined function or an internal function.
cd4315a
  
cd4315a
  
cd4315a
! garbagecollect()					*garbagecollect()*
cd4315a
  		Cleanup unused |Lists| and |Dictionaries| that have circular
cd4315a
  		references.  There is hardly ever a need to invoke this
cd4315a
  		function, as it is automatically done when Vim runs out of
cd4315a
--- 2673,2679 ----
cd4315a
  		{name} can be a user defined function or an internal function.
cd4315a
  
cd4315a
  
cd4315a
! garbagecollect([at_exit])				*garbagecollect()*
cd4315a
  		Cleanup unused |Lists| and |Dictionaries| that have circular
cd4315a
  		references.  There is hardly ever a need to invoke this
cd4315a
  		function, as it is automatically done when Vim runs out of
cd4315a
***************
cd4315a
*** 2683,2688 ****
cd4315a
--- 2683,2691 ----
cd4315a
  		This is useful if you have deleted a very big |List| and/or
cd4315a
  		|Dictionary| with circular references in a script that runs
cd4315a
  		for a long time.
cd4315a
+ 		When the optional "at_exit" argument is one, garbage
cd4315a
+ 		collection will also be done when exiting Vim, if it wasn't
cd4315a
+ 		done before.  This is useful when checking for memory leaks.
cd4315a
  
cd4315a
  get({list}, {idx} [, {default}])			*get()*
cd4315a
  		Get item {idx} from |List| {list}.  When this item is not
cd4315a
*** ../vim-7.1.119/src/eval.c	Tue Sep 25 12:50:00 2007
cd4315a
--- src/eval.c	Sun Sep 16 19:24:49 2007
cd4315a
***************
cd4315a
*** 6128,6133 ****
cd4315a
--- 6128,6134 ----
cd4315a
      /* Only do this once. */
cd4315a
      want_garbage_collect = FALSE;
cd4315a
      may_garbage_collect = FALSE;
cd4315a
+     garbage_collect_at_exit = FALSE;
cd4315a
  
cd4315a
      /*
cd4315a
       * 1. Go through all accessible variables and mark all lists and dicts
cd4315a
***************
cd4315a
*** 7110,7116 ****
cd4315a
      {"foldtextresult",	1, 1, f_foldtextresult},
cd4315a
      {"foreground",	0, 0, f_foreground},
cd4315a
      {"function",	1, 1, f_function},
cd4315a
!     {"garbagecollect",	0, 0, f_garbagecollect},
cd4315a
      {"get",		2, 3, f_get},
cd4315a
      {"getbufline",	2, 3, f_getbufline},
cd4315a
      {"getbufvar",	2, 2, f_getbufvar},
cd4315a
--- 7111,7117 ----
cd4315a
      {"foldtextresult",	1, 1, f_foldtextresult},
cd4315a
      {"foreground",	0, 0, f_foreground},
cd4315a
      {"function",	1, 1, f_function},
cd4315a
!     {"garbagecollect",	0, 1, f_garbagecollect},
cd4315a
      {"get",		2, 3, f_get},
cd4315a
      {"getbufline",	2, 3, f_getbufline},
cd4315a
      {"getbufvar",	2, 2, f_getbufvar},
cd4315a
***************
cd4315a
*** 9719,9724 ****
cd4315a
--- 9720,9728 ----
cd4315a
      /* This is postponed until we are back at the toplevel, because we may be
cd4315a
       * using Lists and Dicts internally.  E.g.: ":echo [garbagecollect()]". */
cd4315a
      want_garbage_collect = TRUE;
cd4315a
+ 
cd4315a
+     if (argvars[0].v_type != VAR_UNKNOWN && get_tv_number(&argvars[0]) == 1)
cd4315a
+ 	garbage_collect_at_exit = TRUE;
cd4315a
  }
cd4315a
  
cd4315a
  /*
cd4315a
*** ../vim-7.1.119/src/globals.h	Thu Aug 30 13:51:52 2007
cd4315a
--- src/globals.h	Sun Sep 16 18:42:41 2007
cd4315a
***************
cd4315a
*** 301,313 ****
cd4315a
  #endif
cd4315a
  
cd4315a
  #ifdef FEAT_EVAL
cd4315a
! /* Garbage collection can only take place when we are sure there are no Lists
cd4315a
   * or Dictionaries being used internally.  This is flagged with
cd4315a
   * "may_garbage_collect" when we are at the toplevel.
cd4315a
   * "want_garbage_collect" is set by the garbagecollect() function, which means
cd4315a
!  * we do garbage collection before waiting for a char at the toplevel. */
cd4315a
  EXTERN int	may_garbage_collect INIT(= FALSE);
cd4315a
  EXTERN int	want_garbage_collect INIT(= FALSE);
cd4315a
  
cd4315a
  /* ID of script being sourced or was sourced to define the current function. */
cd4315a
  EXTERN scid_T	current_SID INIT(= 0);
cd4315a
--- 301,317 ----
cd4315a
  #endif
cd4315a
  
cd4315a
  #ifdef FEAT_EVAL
cd4315a
! /*
cd4315a
!  * Garbage collection can only take place when we are sure there are no Lists
cd4315a
   * or Dictionaries being used internally.  This is flagged with
cd4315a
   * "may_garbage_collect" when we are at the toplevel.
cd4315a
   * "want_garbage_collect" is set by the garbagecollect() function, which means
cd4315a
!  * we do garbage collection before waiting for a char at the toplevel.
cd4315a
!  * "garbage_collect_at_exit" indicates garbagecollect(1) was called.
cd4315a
!  */
cd4315a
  EXTERN int	may_garbage_collect INIT(= FALSE);
cd4315a
  EXTERN int	want_garbage_collect INIT(= FALSE);
cd4315a
+ EXTERN int	garbage_collect_at_exit INIT(= FALSE);
cd4315a
  
cd4315a
  /* ID of script being sourced or was sourced to define the current function. */
cd4315a
  EXTERN scid_T	current_SID INIT(= 0);
cd4315a
*** ../vim-7.1.119/src/main.c	Thu Sep  6 17:38:06 2007
cd4315a
--- src/main.c	Sun Sep 16 18:44:54 2007
cd4315a
***************
cd4315a
*** 1334,1339 ****
cd4315a
--- 1334,1343 ----
cd4315a
  #ifdef FEAT_CSCOPE
cd4315a
      cs_end();
cd4315a
  #endif
cd4315a
+ #ifdef FEAT_EVAL
cd4315a
+     if (garbage_collect_at_exit)
cd4315a
+ 	garbage_collect();
cd4315a
+ #endif
cd4315a
  
cd4315a
      mch_exit(exitval);
cd4315a
  }
cd4315a
*** ../vim-7.1.119/src/testdir/Makefile	Tue Aug 14 17:28:14 2007
cd4315a
--- src/testdir/Makefile	Mon Sep 17 20:04:13 2007
cd4315a
***************
cd4315a
*** 6,12 ****
cd4315a
  
cd4315a
  # Uncomment this line for using valgrind.
cd4315a
  # The output goes into a file "valgrind.$PID" (sorry, no test number).
cd4315a
! # VALGRIND = valgrind --tool=memcheck --num-callers=15 --logfile=valgrind
cd4315a
  
cd4315a
  SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
cd4315a
  		test7.out test8.out test9.out test10.out test11.out \
cd4315a
--- 6,12 ----
cd4315a
  
cd4315a
  # Uncomment this line for using valgrind.
cd4315a
  # The output goes into a file "valgrind.$PID" (sorry, no test number).
cd4315a
! # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --logfile=valgrind
cd4315a
  
cd4315a
  SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
cd4315a
  		test7.out test8.out test9.out test10.out test11.out \
cd4315a
***************
cd4315a
*** 39,45 ****
cd4315a
  $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
cd4315a
  
cd4315a
  clean:
cd4315a
! 	-rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* viminfo
cd4315a
  
cd4315a
  test1.out: test1.in
cd4315a
  	-rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
cd4315a
--- 39,45 ----
cd4315a
  $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
cd4315a
  
cd4315a
  clean:
cd4315a
! 	-rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo
cd4315a
  
cd4315a
  test1.out: test1.in
cd4315a
  	-rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
cd4315a
***************
cd4315a
*** 65,70 ****
cd4315a
--- 65,74 ----
cd4315a
  		else echo $* NO OUTPUT >>test.log; \
cd4315a
  		fi"
cd4315a
  	-rm -rf X* test.ok viminfo
cd4315a
+ 
cd4315a
+ test49.out: test49.vim
cd4315a
+ 
cd4315a
+ test60.out: test60.vim
cd4315a
  
cd4315a
  nolog:
cd4315a
  	-echo Test results: >test.log
cd4315a
*** ../vim-7.1.119/src/testdir/test14.in	Sun Jun 13 20:24:08 2004
cd4315a
--- src/testdir/test14.in	Sun Sep 16 15:57:54 2007
cd4315a
***************
cd4315a
*** 18,23 ****
cd4315a
--- 18,24 ----
cd4315a
  : let tt = "o\<C-V>65\<C-V>x42\<C-V>o103 \<C-V>33a\<C-V>xfg\<C-V>o78\<Esc>"
cd4315a
  :endif
cd4315a
  :exe "normal " . tt
cd4315a
+ :unlet tt
cd4315a
  :.w >>test.out
cd4315a
  :set vb
cd4315a
  /^Piece
cd4315a
*** ../vim-7.1.119/src/testdir/test26.in	Sun Jun 13 17:05:48 2004
cd4315a
--- src/testdir/test26.in	Sun Sep 16 16:54:19 2007
cd4315a
***************
cd4315a
*** 37,42 ****
cd4315a
--- 37,43 ----
cd4315a
  :    endif
cd4315a
  :  endif
cd4315a
  :endwhile
cd4315a
+ :unlet i j
cd4315a
  :'t,$w! test.out
cd4315a
  :qa!
cd4315a
  ENDTEST
cd4315a
*** ../vim-7.1.119/src/testdir/test34.in	Sun Apr 30 20:46:14 2006
cd4315a
--- src/testdir/test34.in	Sun Sep 16 21:25:47 2007
cd4315a
***************
cd4315a
*** 52,58 ****
cd4315a
  ---*---
cd4315a
  (one
cd4315a
  (two
cd4315a
! [(one again?:$-5,$wq! test.out
cd4315a
  ENDTEST
cd4315a
  
cd4315a
  here
cd4315a
--- 52,66 ----
cd4315a
  ---*---
cd4315a
  (one
cd4315a
  (two
cd4315a
! [(one again?:$-5,$w! test.out
cd4315a
! :delfunc Table
cd4315a
! :delfunc Compute
cd4315a
! :delfunc Expr1
cd4315a
! :delfunc Expr2
cd4315a
! :delfunc ListItem
cd4315a
! :delfunc ListReset
cd4315a
! :unlet retval counter
cd4315a
! :q!
cd4315a
  ENDTEST
cd4315a
  
cd4315a
  here
cd4315a
*** ../vim-7.1.119/src/testdir/test45.in	Sun Jun 13 19:57:02 2004
cd4315a
--- src/testdir/test45.in	Sun Sep 16 18:27:20 2007
cd4315a
***************
cd4315a
*** 55,60 ****
cd4315a
--- 55,61 ----
cd4315a
  /kk$
cd4315a
  :call append("$", foldlevel("."))
cd4315a
  :/^last/+1,$w! test.out
cd4315a
+ :delfun Flvl
cd4315a
  :qa!
cd4315a
  ENDTEST
cd4315a
  
cd4315a
*** ../vim-7.1.119/src/testdir/test47.in	Sun Jun 13 18:40:29 2004
cd4315a
--- src/testdir/test47.in	Sun Sep 16 18:32:03 2007
cd4315a
***************
cd4315a
*** 34,39 ****
cd4315a
--- 34,40 ----
cd4315a
  :call append("$", two)
cd4315a
  :call append("$", three)
cd4315a
  :$-2,$w! test.out
cd4315a
+ :unlet one two three
cd4315a
  :qa!
cd4315a
  ENDTEST
cd4315a
  
cd4315a
*** ../vim-7.1.119/src/testdir/test49.in	Sun Jun 13 18:10:00 2004
cd4315a
--- src/testdir/test49.in	Sun Sep 16 23:30:35 2007
cd4315a
***************
cd4315a
*** 1,13 ****
cd4315a
  This is a test of the script language.
cd4315a
  
cd4315a
  If after adding a new test, the test output doesn't appear properly in
cd4315a
! test49.failed, try to add one ore more "G"s at the line before ENDTEST.
cd4315a
  
cd4315a
  STARTTEST
cd4315a
  :so small.vim
cd4315a
  :se nocp nomore viminfo+=nviminfo
cd4315a
  :so test49.vim
cd4315a
! GGGGGGGGGG"rp:.-,$wq! test.out
cd4315a
  ENDTEST
cd4315a
  
cd4315a
  Results of test49.vim:
cd4315a
--- 1,29 ----
cd4315a
  This is a test of the script language.
cd4315a
  
cd4315a
  If after adding a new test, the test output doesn't appear properly in
cd4315a
! test49.failed, try to add one ore more "G"s at the line ending in "test.out"
cd4315a
  
cd4315a
  STARTTEST
cd4315a
  :so small.vim
cd4315a
  :se nocp nomore viminfo+=nviminfo
cd4315a
  :so test49.vim
cd4315a
! GGGGGGGGGGGGGG"rp:.-,$w! test.out
cd4315a
! :"
cd4315a
! :" make valgrind happy
cd4315a
! :redir => funclist
cd4315a
! :silent func
cd4315a
! :redir END
cd4315a
! :for line in split(funclist, "\n")
cd4315a
! :  let name = matchstr(line, 'function \zs[A-Z]\w*\ze(')
cd4315a
! :  if name != ''
cd4315a
! :    exe "delfunc " . name
cd4315a
! :  endif
cd4315a
! :endfor
cd4315a
! :for v in keys(g:)
cd4315a
! :  silent! exe "unlet " . v
cd4315a
! :endfor
cd4315a
! :unlet v
cd4315a
! :qa!
cd4315a
  ENDTEST
cd4315a
  
cd4315a
  Results of test49.vim:
cd4315a
*** ../vim-7.1.119/src/testdir/test55.in	Sat May  5 20:03:56 2007
cd4315a
--- src/testdir/test55.in	Mon Sep 17 19:53:48 2007
cd4315a
***************
cd4315a
*** 345,350 ****
cd4315a
--- 345,354 ----
cd4315a
  :endfun
cd4315a
  :call Test(1, 2, [3, 4], {5: 6})  " This may take a while
cd4315a
  :"
cd4315a
+ :delfunc Test
cd4315a
+ :unlet dict
cd4315a
+ :call garbagecollect(1)
cd4315a
+ :"
cd4315a
  :/^start:/,$wq! test.out
cd4315a
  ENDTEST
cd4315a
  
cd4315a
*** ../vim-7.1.119/src/testdir/test56.in	Tue Sep  5 13:36:02 2006
cd4315a
--- src/testdir/test56.in	Sun Sep 16 17:54:20 2007
cd4315a
***************
cd4315a
*** 17,21 ****
cd4315a
  fun s:DoNothing()
cd4315a
    call append(line('$'), "nothing line")
cd4315a
  endfun
cd4315a
! nnoremap <buffer> _x	:call <SID>DoNothing()<bar>call <SID>DoLast()<cr>
cd4315a
  end:
cd4315a
--- 17,21 ----
cd4315a
  fun s:DoNothing()
cd4315a
    call append(line('$'), "nothing line")
cd4315a
  endfun
cd4315a
! nnoremap <buffer> _x	:call <SID>DoNothing()<bar>call <SID>DoLast()<bar>delfunc <SID>DoNothing<bar>delfunc <SID>DoLast<cr>
cd4315a
  end:
cd4315a
*** ../vim-7.1.119/src/testdir/test58.in	Wed Apr  5 22:38:56 2006
cd4315a
--- src/testdir/test58.in	Sun Sep 16 18:17:03 2007
cd4315a
***************
cd4315a
*** 86,91 ****
cd4315a
--- 86,92 ----
cd4315a
  :$put =str
cd4315a
  `m]s:let [str, a] = spellbadword()
cd4315a
  :$put =str
cd4315a
+ :unlet str a
cd4315a
  :"
cd4315a
  :" Postponed prefixes
cd4315a
  :call TestOne('2', '1')
cd4315a
***************
cd4315a
*** 99,104 ****
cd4315a
--- 100,109 ----
cd4315a
  :"
cd4315a
  :" NOSLITSUGS
cd4315a
  :call TestOne('8', '8')
cd4315a
+ :"
cd4315a
+ :" clean up for valgrind
cd4315a
+ :delfunc TestOne
cd4315a
+ :set spl= enc=latin1
cd4315a
  :"
cd4315a
  gg:/^test output:/,$wq! test.out
cd4315a
  ENDTEST
cd4315a
*** ../vim-7.1.119/src/testdir/test59.in	Wed Apr  5 22:27:11 2006
cd4315a
--- src/testdir/test59.in	Sun Sep 16 18:17:23 2007
cd4315a
***************
cd4315a
*** 90,95 ****
cd4315a
--- 90,96 ----
cd4315a
  :$put =str
cd4315a
  `m]s:let [str, a] = spellbadword()
cd4315a
  :$put =str
cd4315a
+ :unlet str a
cd4315a
  :"
cd4315a
  :" Postponed prefixes
cd4315a
  :call TestOne('2', '1')
cd4315a
***************
cd4315a
*** 100,105 ****
cd4315a
--- 101,110 ----
cd4315a
  :call TestOne('5', '5')
cd4315a
  :call TestOne('6', '6')
cd4315a
  :call TestOne('7', '7')
cd4315a
+ :"
cd4315a
+ :" clean up for valgrind
cd4315a
+ :delfunc TestOne
cd4315a
+ :set spl= enc=latin1
cd4315a
  :"
cd4315a
  gg:/^test output:/,$wq! test.out
cd4315a
  ENDTEST
cd4315a
*** ../vim-7.1.119/src/testdir/test60.in	Fri May  5 23:11:11 2006
cd4315a
--- src/testdir/test60.in	Mon Sep 17 19:58:43 2007
cd4315a
***************
cd4315a
*** 569,574 ****
cd4315a
--- 569,577 ----
cd4315a
      redir END
cd4315a
  endfunction
cd4315a
  :call TestExists()
cd4315a
+ :delfunc TestExists
cd4315a
+ :delfunc RunTest
cd4315a
+ :delfunc TestFuncArg
cd4315a
  :edit! test.out
cd4315a
  :set ff=unix
cd4315a
  :w
cd4315a
*** ../vim-7.1.119/src/testdir/test60.vim	Fri Jan 13 00:14:55 2006
cd4315a
--- src/testdir/test60.vim	Mon Sep 17 19:56:02 2007
cd4315a
***************
cd4315a
*** 94,97 ****
cd4315a
--- 94,98 ----
cd4315a
  else
cd4315a
      echo "FAILED"
cd4315a
  endif
cd4315a
+ unlet str
cd4315a
  
cd4315a
*** ../vim-7.1.119/src/testdir/test62.in	Sun Apr 30 20:28:14 2006
cd4315a
--- src/testdir/test62.in	Sun Sep 16 17:24:04 2007
cd4315a
***************
cd4315a
*** 7,12 ****
cd4315a
--- 7,13 ----
cd4315a
  :let nr = tabpagenr()
cd4315a
  :q
cd4315a
  :call append(line('$'), 'tab page ' . nr)
cd4315a
+ :unlet nr
cd4315a
  :"
cd4315a
  :" Open three tab pages and use ":tabdo"
cd4315a
  :0tabnew
cd4315a
***************
cd4315a
*** 23,28 ****
cd4315a
--- 24,30 ----
cd4315a
  :q!
cd4315a
  :call append(line('$'), line1)
cd4315a
  :call append(line('$'), line2)
cd4315a
+ :unlet line1 line2
cd4315a
  :"
cd4315a
  :"
cd4315a
  :/^Results/,$w! test.out
cd4315a
*** ../vim-7.1.119/src/testdir/test63.in	Thu Jul 26 22:55:11 2007
cd4315a
--- src/testdir/test63.in	Sun Sep 16 17:11:07 2007
cd4315a
***************
cd4315a
*** 60,66 ****
cd4315a
  :else
cd4315a
  :  let @r .= "FAILED\n"
cd4315a
  :endif
cd4315a
! :" --- Check that "matchdelete()" returns 0 if succesfull and otherwise -1.
cd4315a
  :let @r .= "*** Test 6: "
cd4315a
  :let m = matchadd("MyGroup1", "TODO")
cd4315a
  :let r1 = matchdelete(m)
cd4315a
--- 60,66 ----
cd4315a
  :else
cd4315a
  :  let @r .= "FAILED\n"
cd4315a
  :endif
cd4315a
! :" --- Check that "matchdelete()" returns 0 if successful and otherwise -1.
cd4315a
  :let @r .= "*** Test 6: "
cd4315a
  :let m = matchadd("MyGroup1", "TODO")
cd4315a
  :let r1 = matchdelete(m)
cd4315a
***************
cd4315a
*** 117,123 ****
cd4315a
  :" --- Check that "setmatches()" will not add two matches with the same ID. The
cd4315a
  :" --- expected behaviour (for now) is to add the first match but not the
cd4315a
  :" --- second and to return 0 (even though it is a matter of debate whether
cd4315a
! :" --- this can be considered succesfull behaviour).
cd4315a
  :let @r .= "*** Test 9: "
cd4315a
  :let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])
cd4315a
  :if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}] && r1 == 0
cd4315a
--- 117,123 ----
cd4315a
  :" --- Check that "setmatches()" will not add two matches with the same ID. The
cd4315a
  :" --- expected behaviour (for now) is to add the first match but not the
cd4315a
  :" --- second and to return 0 (even though it is a matter of debate whether
cd4315a
! :" --- this can be considered successful behaviour).
cd4315a
  :let @r .= "*** Test 9: "
cd4315a
  :let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])
cd4315a
  :if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}] && r1 == 0
cd4315a
***************
cd4315a
*** 127,133 ****
cd4315a
  :endif
cd4315a
  :call clearmatches()
cd4315a
  :unlet r1
cd4315a
! :" --- Check that "setmatches()" returns 0 if succesfull and otherwise -1.
cd4315a
  :" --- (A range of valid and invalid input values are tried out to generate the
cd4315a
  :" --- return values.)
cd4315a
  :let @r .= "*** Test 10: "
cd4315a
--- 127,133 ----
cd4315a
  :endif
cd4315a
  :call clearmatches()
cd4315a
  :unlet r1
cd4315a
! :" --- Check that "setmatches()" returns 0 if successful and otherwise -1.
cd4315a
  :" --- (A range of valid and invalid input values are tried out to generate the
cd4315a
  :" --- return values.)
cd4315a
  :let @r .= "*** Test 10: "
cd4315a
*** ../vim-7.1.119/src/testdir/test64.in	Tue Aug 14 17:28:14 2007
cd4315a
--- src/testdir/test64.in	Sun Sep 16 17:43:03 2007
cd4315a
***************
cd4315a
*** 44,51 ****
cd4315a
--- 44,53 ----
cd4315a
  :        $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
cd4315a
  :      endif
cd4315a
  :    endfor
cd4315a
+ :    unlet i
cd4315a
  :  endif
cd4315a
  :endfor
cd4315a
+ :unlet t tl e l
cd4315a
  :/^Results/,$wq! test.out
cd4315a
  ENDTEST
cd4315a
  
cd4315a
*** ../vim-7.1.119/src/version.c	Tue Sep 25 14:50:19 2007
cd4315a
--- src/version.c	Tue Sep 25 17:36:22 2007
cd4315a
***************
cd4315a
*** 668,669 ****
cd4315a
--- 668,671 ----
cd4315a
  {   /* Add new patch number below this line */
cd4315a
+ /**/
cd4315a
+     120,
cd4315a
  /**/
cd4315a
cd4315a
-- 
cd4315a
BEDEVERE: How do you know so much about swallows?
cd4315a
ARTHUR:   Well you have to know these things when you're a king, you know.
cd4315a
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
cd4315a
cd4315a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
cd4315a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
cd4315a
\\\        download, build and distribute -- http://www.A-A-P.org        ///
cd4315a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///