Commit: patch 9.1.0805: tests: minor issues in gen_opt_test.vim

2 views
Skip to first unread message

Christian Brabandt

unread,
Oct 22, 2024, 5:00:12 PM10/22/24
to vim...@googlegroups.com
patch 9.1.0805: tests: minor issues in gen_opt_test.vim

Commit: https://github.com/vim/vim/commit/231480f9753fa3fb28e17b670550ce43172c0eba
Author: Milly <mill...@gmail.com>
Date: Tue Oct 22 22:53:01 2024 +0200

patch 9.1.0805: tests: minor issues in gen_opt_test.vim

Problem: tests: minor issues in gen_opt_test.vim
Solution: fix restore value for 'undolevels', fix comment, fix
wrong cpo value, add equality test for global-local options on
switchback (Milly).

closes: #15913

Signed-off-by: Milly <mill...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim
index 7e89e7342..5e582fa7a 100644
--- a/src/testdir/gen_opt_test.vim
+++ b/src/testdir/gen_opt_test.vim
@@ -1,7 +1,7 @@
" Script to generate src/testdir/opt_test.vim from src/optiondefs.h and
" runtime/doc/options.txt

-set cpo=&vim
+set cpo&vim

" Only do this when build with the +eval feature.
if 1
@@ -25,7 +25,7 @@ endwhile
call extend(global_locals, #{
\ scrolloff: -1,
\ sidescrolloff: -1,
- \ undolevels: -12345,
+ \ undolevels: -123456,
\})

" Get local-noglobal options.
@@ -56,7 +56,8 @@ let skip_setglobal_reasons = #{
\ textwidth: 'TODO: fix missing error handling for setglobal',
\}

-" The terminal size is restored at the end.
+" Script header.
+" The test values contains multibyte characters.
let script = [
\ '" DO NOT EDIT: Generated with gen_opt_test.vim',
\ '" Used by test_options_all.vim.',
@@ -417,8 +418,9 @@ while 1
endfor
" Testing to clear the local value and switch back to the global value.
if global_locals->has_key(fullname)
- let swichback_val = global_locals[fullname]
- call add(script, $'setlocal {opt}={swichback_val}')
+ let switchback_val = global_locals[fullname]
+ call add(script, $'setlocal {opt}={switchback_val}')
+ call add(script, $'call assert_equal(&g:{fullname}, &{fullname})')
endif
endfor

diff --git a/src/version.c b/src/version.c
index 59260d1e3..8f1d6066e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 805,
/**/
804,
/**/
Reply all
Reply to author
Forward
0 new messages