diff runtime/doc/testing.txt @ 32452:c1f730c2b51e v9.0.1557

patch 9.0.1557: test failures for unreachable code Commit: https://github.com/vim/vim/commit/9d383f30bbd06552ad0bf343b2c03c6a0d1f6df2 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 14 21:38:12 2023 +0100 patch 9.0.1557: test failures for unreachable code Problem: Test failures for unreachable code. Solution: Add a test override to ignore unreachable code.
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 May 2023 22:45:04 +0200
parents 2a17771529af
children 635de73eeb4c
line wrap: on
line diff
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -369,6 +369,7 @@ test_override({name}, {val})				*test_ov
 			     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_ov
 		"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')