summaryrefslogtreecommitdiff
path: root/src/testdir/test_options.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-24 20:57:01 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-24 20:57:01 +0200
commit65d032c779a43b767497e15e6a32d04a6a8fa65d (patch)
tree23d8679105c015540703fd4103c910cd5374eebb /src/testdir/test_options.vim
parente71ebb46a252cd1cdfb075e6014c2b13c580bf3f (diff)
downloadvim-git-65d032c779a43b767497e15e6a32d04a6a8fa65d.tar.gz
patch 8.2.0629: setting a boolean option to v:false does not workv8.2.0629
Problem: Setting a boolean option to v:false does not work. Solution: Do not use the string representation of the value. (Christian Brabandt, closes #5974)
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r--src/testdir/test_options.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index e03d7e99c..dec82885f 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -899,4 +899,18 @@ func Test_opt_num_op()
set shiftwidth&
endfunc
+" Test for setting option values using v:false and v:true
+func Test_opt_boolean()
+ set number&
+ set number
+ call assert_equal(1, &nu)
+ set nonu
+ call assert_equal(0, &nu)
+ let &nu = v:true
+ call assert_equal(1, &nu)
+ let &nu = v:false
+ call assert_equal(0, &nu)
+ set number&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab