" 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
call extend(global_locals, #{
\ scrolloff: -1,
\ sidescrolloff: -1,
- \ undolevels: -12345,
+ \ undolevels: -123456,
\})
" Get local-noglobal options.
\ 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.',
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