]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0706: tests: test_terminal3 may fail when $SHELL is zsh v9.2.0706
authorChristian Brabandt <cb@256bit.org>
Mon, 22 Jun 2026 19:45:05 +0000 (19:45 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Jun 2026 19:45:05 +0000 (19:45 +0000)
Problem:  tests: test_terminal3 may fail when the shell ($SHELL) is zsh
          with a custom prompt, because the prompt wraps the terminal
          line and shifts the expected output.
Solution: Reset $HOME and $PS1 to sane defaults so the shell uses a
          minimal prompt, and adjust the expected window height.

closes: #20599

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_terminal3.vim
src/version.c

index 22d19909a581aa59258f0094152a0f0b896bd55f..cf87038ef116eeee0c9459e6b29665e92e9a1edb 100644 (file)
@@ -1197,7 +1197,7 @@ func Test_terminal_max_combining_chars()
   " somehow doesn't work on MS-Windows
   CheckUnix
   let cmd = "cat samples/terminal_max_combining_chars.txt\<CR>"
-  let buf = Run_shell_in_terminal({'term_rows': 15, 'term_cols': 35})
+  let buf = Run_shell_in_terminal({'term_rows': 15, 'term_cols': 35, 'env': {'HOME': '/nonexisting', 'PS1':''}})
   call TermWait(buf)
   call term_sendkeys(buf, cmd)
   " last char is a space with many combining chars
@@ -1214,6 +1214,8 @@ func Test_term_getpos()
   defer delete('XTest_getpos_result')
 
   let lines =<< trim EOL
+     let $PS1=''
+     let $HOME='/nonexisting'
      term ++curwin sh
   EOL
   call writefile(lines, 'XTest_getpos', 'D')
@@ -1243,8 +1245,8 @@ func Test_term_getpos()
   call WaitForAssert({-> assert_true(filereadable('XTest_getpos_result'))})
   call WaitForAssert({-> assert_equal(2, len(readfile('XTest_getpos_result')))})
   let result = readfile('XTest_getpos_result')
-  " 15 - 1: statusline - 1: for prompt line
-  call assert_equal(13, str2nr(result[1]) - str2nr(result[0]))
+  " 15 - 1: statusline - 1: for prompt line, w$-w0 = 12
+  call assert_equal(12, str2nr(result[1]) - str2nr(result[0]))
   call assert_true(str2nr(result[0]) > 1)
 
   " Regression: line('w0') and line('w$') must not move cursor position
index 14fb4ea48955fd40ce4ac76c47cdea781243bcb2..e663c2117fc1d6f9011045bafe16d8ed8dd66ee9 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    706,
 /**/
     705,
 /**/