1
0
forked from aniani/vim

patch 9.0.1557: test failures for unreachable code

Problem:    Test failures for unreachable code.
Solution:   Add a test override to ignore unreachable code.
This commit is contained in:
Bram Moolenaar
2023-05-14 21:38:12 +01:00
parent cf2610c82b
commit 9d383f30bb
7 changed files with 31 additions and 9 deletions

View File

@@ -490,7 +490,7 @@ def Test_try_catch_throw()
try # comment
add(l, '1')
throw 'wrong'
add(l, '2')
add(l, '2') # "unreachable code"
catch # comment
add(l, v:exception)
finally # comment
@@ -503,7 +503,7 @@ def Test_try_catch_throw()
try
add(l, '1')
throw 'wrong'
add(l, '2')
add(l, '2') # "unreachable code"
catch /right/
add(l, v:exception)
endtry
@@ -754,7 +754,7 @@ def Test_try_catch_throw()
var ret = 5
try
throw 'getout'
return -1
return -1 # "unreachable code"
catch /getout/
# ret is evaluated here
return ret
@@ -1082,7 +1082,12 @@ enddef
def DeletedFunc(): list<any>
return ['delete me']
enddef
defcompile
defcompile DeletedFunc
call test_override('unreachable', 1)
defcompile Test_try_catch_throw
call test_override('unreachable', 0)
delfunc DeletedFunc
def s:ThrowFromDef()
@@ -1128,7 +1133,7 @@ def Test_try_catch_nested()
try
l->add('1')
throw 'bad'
l->add('x')
l->add('x') # "unreachable code"
catch /bad/
l->add('2')
try
@@ -1168,6 +1173,10 @@ def Test_try_catch_nested()
assert_equal(['1', '2', '3', '4'], l)
enddef
call test_override('unreachable', 1)
defcompile Test_try_catch_nested
call test_override('unreachable', 0)
def s:TryOne(): number
try
return 0