summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_script.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-05-14 21:38:12 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-14 21:38:12 +0100
commit9d383f30bbd06552ad0bf343b2c03c6a0d1f6df2 (patch)
tree5eb419bd4d132300b01ffc01c10fd732aedcc2b5 /src/testdir/test_vim9_script.vim
parentcf2610c82b64b1785af0804916789295cae45e93 (diff)
patch 9.0.1557: test failures for unreachable codev9.0.1557
Problem: Test failures for unreachable code. Solution: Add a test override to ignore unreachable code.
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r--src/testdir/test_vim9_script.vim19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index 3541aa7421..d6be8cb693 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -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