aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-05 07:26:33 +0800
committerGitHub <noreply@github.com>2024-11-04 23:26:33 +0000
commitf5b84c1a44069af70a3f0c3330e7cc25b224ad93 (patch)
tree4a5ab3cce90de9b675c8a5057da0dcc9206efd31
parent079e5f4f9b67a5aa2c1b481ce78711bf8c76caea (diff)
downloadrneovim-f5b84c1a44069af70a3f0c3330e7cc25b224ad93.tar.gz
rneovim-f5b84c1a44069af70a3f0c3330e7cc25b224ad93.tar.bz2
rneovim-f5b84c1a44069af70a3f0c3330e7cc25b224ad93.zip
vim-patch:9.1.0841: tests: still preferring python2 over python3 (#31083)
Problem: tests: still preferring python2 over python3 Solution: prefer Python 3 when picking a Python program in Vim tests, by checking for the more specific python version first and only when python3 not found, check for the python binary (Yee Cheng Chin) Most OSes have Python 3 mapped to `python3` instead of `python`. Vim tests should prioritize using that instead of Python 2 in case that is still installed on the host system. closes: vim/vim#15986 https://github.com/vim/vim/commit/cef8ab2c75841cee1cd72266aa662fbe54fc0acc Cherry-pick test changes from patch 8.2.{2824,4684}. Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
-rw-r--r--test/old/testdir/shared.vim12
-rw-r--r--test/old/testdir/test_cmdline.vim4
2 files changed, 12 insertions, 4 deletions
diff --git a/test/old/testdir/shared.vim b/test/old/testdir/shared.vim
index fc7e6b643a..bb1a6c8f5b 100644
--- a/test/old/testdir/shared.vim
+++ b/test/old/testdir/shared.vim
@@ -35,12 +35,20 @@ func PythonProg()
if has('unix')
" We also need the job feature or the pkill command to make sure the server
" can be stopped.
- if !(executable('python') && (has('job') || executable('pkill')))
+ if !(has('job') || executable('pkill'))
return ''
endif
- let s:python = 'python'
+ if executable('python3')
+ let s:python = 'python3'
+ elseif executable('python')
+ let s:python = 'python'
+ else
+ return ''
+ end
elseif has('win32')
" Use Python Launcher for Windows (py.exe) if available.
+ " NOTE: if you get a "Python was not found" error, disable the Python
+ " shortcuts in "Windows menu / Settings / Manage App Execution Aliases".
if executable('py.exe')
let s:python = 'py.exe'
elseif executable('python.exe')
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index 27165bb606..8d405790e9 100644
--- a/test/old/testdir/test_cmdline.vim
+++ b/test/old/testdir/test_cmdline.vim
@@ -727,8 +727,8 @@ func Test_fullcommand()
\ ':5s': 'substitute',
\ "'<,'>s": 'substitute',
\ ":'<,'>s": 'substitute',
- \ 'CheckUni': 'CheckUnix',
- \ 'CheckUnix': 'CheckUnix',
+ \ 'CheckLin': 'CheckLinux',
+ \ 'CheckLinux': 'CheckLinux',
\ }
for [in, want] in items(tests)