aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-06-06 11:26:07 +0000
committerGitHub <noreply@github.com>2017-06-06 11:26:07 +0000
commitcb0abce5be1dd6212425589b61826332834dc977 (patch)
tree5e03746ac51971cf2b15960ff068171d91710b23 /src/nvim/testdir/test_functions.vim
parent45d92e25638fda668e1e15fb99b54e588769656f (diff)
parent75c32b549bb505890e657d760e10295cb58cb7fc (diff)
downloadrneovim-cb0abce5be1dd6212425589b61826332834dc977.tar.gz
rneovim-cb0abce5be1dd6212425589b61826332834dc977.tar.bz2
rneovim-cb0abce5be1dd6212425589b61826332834dc977.zip
Merge pull request #6854 from jamessan/vim-8.0.0156
vim-patch:8.0.0156,8.0.0158,8.0.0167,8.0.0168,8.0.0360,8.0.0477,8.0.0478,8.0.0176,8.0.0561
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 3c258299c1..237a2dc820 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -1,3 +1,22 @@
+" Tests for various functions.
+
+func Test_str2nr()
+ call assert_equal(0, str2nr(''))
+ call assert_equal(1, str2nr('1'))
+ call assert_equal(1, str2nr(' 1 '))
+
+ call assert_equal(1, str2nr('+1'))
+ call assert_equal(1, str2nr('+ 1'))
+ call assert_equal(1, str2nr(' + 1 '))
+
+ call assert_equal(-1, str2nr('-1'))
+ call assert_equal(-1, str2nr('- 1'))
+ call assert_equal(-1, str2nr(' - 1 '))
+
+ call assert_equal(123456789, str2nr('123456789'))
+ call assert_equal(-123456789, str2nr('-123456789'))
+endfunc
+
func Test_setbufvar_options()
" This tests that aucmd_prepbuf() and aucmd_restbuf() properly restore the
" window layout.