summaryrefslogtreecommitdiff
path: root/src/testdir/test_vartabs.vim
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-06-12 13:46:41 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-12 13:46:41 +0200
commit5958549760652c173b703613b9cbf09b25a4eddb (patch)
tree5acca6c4929b41affd9d7aaa2eadb8a65472ebcc /src/testdir/test_vartabs.vim
parent744aecf8777e86fac6d30f072e90e2de353b8ea1 (diff)
downloadvim-git-5958549760652c173b703613b9cbf09b25a4eddb.tar.gz
patch 8.2.2979: not all options code is covered by testsv8.2.2979
Problem: Not all options code is covered by tests. Solution: Add more tests for options. (Yegappan Lakshmanan, closes #8369)
Diffstat (limited to 'src/testdir/test_vartabs.vim')
-rw-r--r--src/testdir/test_vartabs.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_vartabs.vim b/src/testdir/test_vartabs.vim
index 0ff1ea8ac..3b8a9ce0b 100644
--- a/src/testdir/test_vartabs.vim
+++ b/src/testdir/test_vartabs.vim
@@ -419,4 +419,17 @@ func Test_varsofttabstop()
close!
endfunc
+" Setting 'shiftwidth' to a negative value, should set it to either the value
+" of 'tabstop' (if 'vartabstop' is not set) or to the first value in
+" 'vartabstop'
+func Test_shiftwidth_vartabstop()
+ setlocal tabstop=7 vartabstop=
+ call assert_fails('set shiftwidth=-1', 'E487:')
+ call assert_equal(7, &shiftwidth)
+ setlocal tabstop=7 vartabstop=5,7,10
+ call assert_fails('set shiftwidth=-1', 'E487:')
+ call assert_equal(5, &shiftwidth)
+ setlocal shiftwidth& vartabstop& tabstop&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab