Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.4.790
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.790 (after 7.4.786)
Problem:    Test fails when the autochdir feature is not available.  Test
            output contains the test script.
Solution:   Check for the autochdir feature. (Kazunobu Kuriyama)  Only write
            the relevant test output.
Files:      src/testdir/test_autocmd_option.in,
            src/testdir/test_autocmd_option.ok


*** ../vim-7.4.789/src/testdir/test_autocmd_option.in	2015-07-17 17:38:00.567399623 +0200
--- src/testdir/test_autocmd_option.in	2015-07-21 10:51:40.170669685 +0200
***************
*** 2,8 ****
  
  STARTTEST
  :so small.vim
! :if !has("eval") || !has("autocmd") | e! test.ok | w! test.out | qa! | endif
  :fu! AutoCommand(match)
  :	let c=g:testcase
  :       let item=remove(g:options, 0)
--- 2,8 ----
  
  STARTTEST
  :so small.vim
! :if !has("eval") || !has("autocmd") || !exists("+autochdir") | e! test.ok | w! test.out | qa! | endif
  :fu! AutoCommand(match)
  :	let c=g:testcase
  :       let item=remove(g:options, 0)
***************
*** 67,73 ****
  :setlocal key=blah
  :setlocal key=
  :$put =g:testcase
! :%w! test.out
  :qa!
  ENDTEST
  dummy text
--- 67,73 ----
  :setlocal key=blah
  :setlocal key=
  :$put =g:testcase
! :/^dummy text/,$w! test.out
  :qa!
  ENDTEST
  dummy text
*** ../vim-7.4.789/src/testdir/test_autocmd_option.ok	2015-07-17 17:38:00.567399623 +0200
--- src/testdir/test_autocmd_option.ok	2015-07-21 10:51:19.962860786 +0200
***************
*** 1,75 ****
- Test for option autocommand
- 
- STARTTEST
- :so small.vim
- :if !has("eval") || !has("autocmd") | e! test.ok | w! test.out | qa! | endif
- :fu! AutoCommand(match)
- :	let c=g:testcase
- :       let item=remove(g:options, 0)
- :       let c.=printf("Expected: Name: <%s>, Oldval: <%s>, NewVal: <%s>, Scope: <%s>\n", item[0], item[1], item[2], item[3])
- :       let c.=printf("Autocmd Option: <%s>,", a:match)
- :       let c.=printf(" OldVal: <%s>,", v:option_old)
- :       let c.=printf(" NewVal: <%s>,", v:option_new)
- :       let c.=printf(" Scope: <%s>\n", v:option_type)
- :       call setreg('r', printf("%s\n%s", getreg('r'), c))
- :endfu
- :au OptionSet * :call AutoCommand(expand("<amatch>"))
- :let g:testcase="1: Setting number option\n"
- :let g:options=[['number', 0, 1, 'global']]
- :set nu
- :let g:testcase="2: Setting local number option\n"
- :let g:options=[['number', 1, 0, 'local']]
- :setlocal nonu
- :let g:testcase="3: Setting global number option\n"
- :let g:options=[['number', 1, 0, 'global']]
- :setglobal nonu
- :let g:testcase="4: Setting local autoindent option\n"
- :let g:options=[['autoindent', 0, 1, 'local']]
- :setlocal ai
- :let g:testcase="5: Setting global autoindent option\n"
- :let g:options=[['autoindent', 0, 1, 'global']]
- :setglobal ai
- :let g:testcase="6: Setting global autoindent option\n"
- :let g:options=[['autoindent', 1, 0, 'global']]
- :set ai!
- : Should not print anything, use :noa
- :noa :set nonu
- :let g:testcase="7: Setting several global list and number option\n"
- :let g:options=[['list', 0, 1, 'global'], ['number', 0, 1, 'global']]
- :set list nu
- :noa set nolist nonu
- :let g:testcase="8: Setting global acd\n"
- :let g:options=[['autochdir', 0, 1, 'global']]
- :setlocal acd
- :let g:testcase="9: Setting global autoread\n"
- :let g:options=[['autoread', 0, 1, 'global']]
- :set ar
- :let g:testcase="10: Setting local autoread\n"
- :let g:options=[['autoread', 0, 1, 'local']]
- :setlocal ar
- :let g:testcase="11: Setting global autoread\n"
- :let g:options=[['autoread', 1, 0, 'global']]
- :setglobal invar
- :let g:testcase="12: Setting option backspace through :let\n"
- :let g:options=[['backspace', '', 'eol,indent,start', 'global']]
- :let &bs="eol,indent,start"
- :let g:testcase="13: Setting option backspace through setbufvar()\n"
- :let g:options=[['backup', '', '1', 'local']]
- : "try twice, first time, shouldn't trigger because option name is invalid, second time, it should trigger
- :call setbufvar(1, '&l:bk', 1)
- : "should trigger, use correct option name
- :call setbufvar(1, '&backup', 1)
- :" Write register now, because next test shouldn't output anything.
- :$put r
- :let @r=''
- :let g:testcase="\n14: Setting key option, shouldn't trigger\n"
- :let g:options=[['key', 'invalid', 'invalid1', 'invalid']]
- :setlocal key=blah
- :setlocal key=
- :$put =g:testcase
- :%w! test.out
- :qa!
- ENDTEST
  dummy text
  
  1: Setting number option
--- 1,3 ----
*** ../vim-7.4.789/src/version.c	2015-07-19 14:42:16.573130169 +0200
--- src/version.c	2015-07-21 10:57:00.815637916 +0200
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     790,
  /**/


-- 
hundred-and-one symptoms of being an internet addict:
242. You turn down a better-paying job because it doesn't come with
     a free e-mail account.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///