summaryrefslogtreecommitdiff
path: root/runtime
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 /runtime
parentcf2610c82b64b1785af0804916789295cae45e93 (diff)
downloadvim-git-9d383f30bbd06552ad0bf343b2c03c6a0d1f6df2.tar.gz
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 'runtime')
-rw-r--r--runtime/doc/testing.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 26f1a8f9e..97faea046 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -369,6 +369,7 @@ test_override({name}, {val}) *test_override()*
string is detected
ui_delay time in msec to use in ui_delay(); overrules a
wait time of up to 3 seconds for messages
+ unreachable no error for code after `:throw` and `:return`
uptime overrules sysinfo.uptime
vterm_title setting the window title by a job running in a
terminal window
@@ -378,13 +379,18 @@ test_override({name}, {val}) *test_override()*
"starting" is to be used when a test should behave like
startup was done. Since the tests are run by sourcing a
script the "starting" variable is non-zero. This is usually a
- good thing (tests run faster), but sometimes changes behavior
- in a way that the test doesn't work properly.
+ good thing (tests run faster), but sometimes this changes
+ behavior in a way that the test doesn't work properly.
When using: >
call test_override('starting', 1)
< The value of "starting" is saved. It is restored by: >
call test_override('starting', 0)
+< To make sure the flag is reset later using `:defer` can be
+ useful: >
+ call test_override('unreachable', 1)
+ defer call test_override('unreachable', 0)
+
< Can also be used as a |method|: >
GetOverrideVal()-> test_override('starting')