]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1461: tests do not run or are not reliable on some systems v8.1.1461
authorBram Moolenaar <Bram@vim.org>
Mon, 3 Jun 2019 21:07:25 +0000 (23:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 3 Jun 2019 21:07:25 +0000 (23:07 +0200)
Problem:    Tests do not run or are not reliable on some systems.
Solution:   Use "findstr" instead of "grep" on MS-Windows. Clear
            PROMPT_COMMAND in the terminal test. Delete temp file. Wait for
            output after executing a debug command. (Yegappan Lakshmanan,
            closes #4479)

src/testdir/test_debugger.vim
src/testdir/test_environ.vim
src/testdir/test_filetype.vim
src/testdir/test_source.vim
src/testdir/test_terminal.vim
src/version.c

index 8faf7ac06446f4791218eba7682d92f01e28fc56..4c3d6721f1f2cfe6ca4261cd4baa6c0efb8e31fb 100644 (file)
@@ -52,16 +52,16 @@ func Test_Debugger()
   let buf = RunVimInTerminal('-S Xtest.vim', {})
 
   " Start the Vim debugger
-  call RunDbgCmd(buf, ':debug echo Foo()')
+  call RunDbgCmd(buf, ':debug echo Foo()', ['cmd: echo Foo()'])
 
   " Create a few stack frames by stepping through functions
-  call RunDbgCmd(buf, 'step')
-  call RunDbgCmd(buf, 'step')
-  call RunDbgCmd(buf, 'step')
-  call RunDbgCmd(buf, 'step')
-  call RunDbgCmd(buf, 'step')
-  call RunDbgCmd(buf, 'step')
-  call RunDbgCmd(buf, 'step')
+  call RunDbgCmd(buf, 'step', ['line 1: let var1 = 1'])
+  call RunDbgCmd(buf, 'step', ['line 2: let var2 = Bar(var1) + 9'])
+  call RunDbgCmd(buf, 'step', ['line 1: let var1 = 2 + a:var'])
+  call RunDbgCmd(buf, 'step', ['line 2: let var2 = Bazz(var1) + 4'])
+  call RunDbgCmd(buf, 'step', ['line 1: try'])
+  call RunDbgCmd(buf, 'step', ['line 2: let var1 = 3 + a:var'])
+  call RunDbgCmd(buf, 'step', ['line 3: let var3 = "another var"'])
 
   " check backtrace
   call RunDbgCmd(buf, 'backtrace', [
index 094c4ce36f62149ac78d231790c171811d4f0f0d..76ffe5631b893029df8e7d0b9eb973f0e1ab3c04 100644 (file)
@@ -36,7 +36,7 @@ func Test_external_env()
 
   call setenv('FOO', v:null)
   if has('win32')
-    let result = system('set | grep ^FOO=')
+    let result = system('set | findstr ^FOO=')
   else
     let result = system('env | grep ^FOO=')
   endif
index cb55e28b6399146b38b4f2919e700f038039972a..95fb62e71228868bc28e8d9cd2544a35625dc42c 100644 (file)
@@ -520,7 +520,11 @@ func CheckItems(checks)
       catch
        call assert_report('cannot edit "' . names[i] . '": ' . v:errmsg)
       endtry
-      call assert_equal(ft, &filetype, 'with file name: ' . names[i])
+      if &filetype == '' && &readonly
+       " File exists but not able to edit it (permission denied)
+      else
+       call assert_equal(ft, &filetype, 'with file name: ' . names[i])
+      endif
       bwipe!
     endfor
   endfor
index 5166bafb1546d6fd3991307e22ea678be9c46fee..09baec0b7d11b2c00424e799acbc004b39fafbe9 100644 (file)
@@ -44,4 +44,5 @@ func Test_source_sandbox()
   call assert_equal('hello', getline(1))
   call assert_fails('sandbox source! Xsourcehello', 'E48:')
   bwipe!
+  call delete('Xsourcehello')
 endfunc
index b97cdb310abf55dbc95802b8f241db80eb6e9bf1..9d6fddd01cca07a999e4967d30a13bde081d7036 100644 (file)
@@ -8,6 +8,7 @@ source shared.vim
 source screendump.vim
 
 let s:python = PythonProg()
+let $PROMPT_COMMAND=''
 
 " Open a terminal with a shell, assign the job to g:job and return the buffer
 " number.
index eeaa5efc85cedb8a3293f1d6475cd3d54647cbb8..a7f77faf0d50332fadc750a8a4c66e24bb00ebd2 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1461,
 /**/
     1460,
 /**/