Skip to content

Commit 09cf86d

Browse files
committed
tests: test_terminal.vim, fix expected return code for python3.13 on Windows
For some reasons, on Windows, python3.13 does no longer exit with the expected return code. So let's check for either exit code 1 or 123 in tests Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg() related: python/cpython#129900 Signed-off-by: Christian Brabandt <[email protected]>
1 parent 04be7b4 commit 09cf86d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Diff for: src/testdir/test_terminal.vim

+18-2
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,15 @@ func Test_terminal_eof_arg()
944944
call WaitFor({-> getline('$') =~ 'hello'})
945945
call assert_equal('hello', getline('$'))
946946
endif
947-
call assert_equal(123, bufnr()->term_getjob()->job_info().exitval)
947+
let exitval = bufnr()->term_getjob()->job_info().exitval
948+
if !has('win32')
949+
call assert_equal(123, exitval)
950+
else
951+
" python 3.13 on Windows returns exit code 1
952+
" older versions returned correctly exit code 123
953+
" https://github.com/python/cpython/issues/129900
954+
call assert_match('1\|123', exitval)
955+
endif
948956
%bwipe!
949957
endfunc
950958

@@ -976,7 +984,15 @@ func Test_terminal_duplicate_eof_arg()
976984
call WaitFor({-> getline('$') =~ 'hello'})
977985
call assert_equal('hello', getline('$'))
978986
endif
979-
call assert_equal(123, bufnr()->term_getjob()->job_info().exitval)
987+
let exitval = bufnr()->term_getjob()->job_info().exitval
988+
if !has('win32')
989+
call assert_equal(123, exitval)
990+
else
991+
" python 3.13 on Windows returns exit code 1
992+
" older versions returned correctly exit code 123
993+
" https://github.com/python/cpython/issues/129900
994+
call assert_match('1\|123', exitval)
995+
endif
980996
%bwipe!
981997
endfunc
982998

0 commit comments

Comments
 (0)