From 03f5f78792c578520139a785c0d3d34e284c372d Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 16 Nov 2016 14:12:13 -0500 Subject: vim-patch:7.4.1979 Problem: Getting value of binary option is wrong. (Kent Sibilev) Solution: Fix type cast. Add a test. https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b --- src/nvim/testdir/test_expr.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/nvim/testdir/test_expr.vim') diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 03a9155512..25cbd60114 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -98,6 +98,29 @@ func Test_special_char() call assert_fails('echo "\') endfunc +func Test_option_value() + " boolean + set bri + call assert_equal(1, &bri) + set nobri + call assert_equal(0, &bri) + + " number + set ts=1 + call assert_equal(1, &ts) + set ts=8 + call assert_equal(8, &ts) + + " string + exe "set cedit=\" + call assert_equal("\", &cedit) + set cpo= + call assert_equal("", &cpo) + set cpo=abcdefi + call assert_equal("abcdefi", &cpo) + set cpo&vim +endfunc + func Test_setmatches() hi def link 1 Comment hi def link 2 PreProc -- cgit From c3efb2804a6bcf3b61695cd2b0c60bb16f1ec0a9 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 16 Nov 2016 14:30:20 -0500 Subject: vim-patch:7.4.2029 Problem: printf() does not work with 64 bit numbers. Solution: use the "L" length modifier. (Ken Takata) https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57 --- src/nvim/testdir/test_expr.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir/test_expr.vim') diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 25cbd60114..04979b867f 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -121,6 +121,12 @@ func Test_option_value() set cpo&vim endfunc +function Test_printf_64bit() + if has('num64') + call assert_equal("123456789012345", printf('%d', 123456789012345)) + endif +endfunc + func Test_setmatches() hi def link 1 Comment hi def link 2 PreProc -- cgit From d707b2a1711a02307a02684904b12b74cfb2ea32 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 5 Jun 2017 23:41:46 -0400 Subject: vim-patch:8.0.0478 Problem: Tests use assert_true(0) and assert_false(1) to report errors. Solution: Use assert_report(). https://github.com/vim/vim/commit/37175409d766ce67f2548dffa6d73451379b5737 --- src/nvim/testdir/test_expr.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_expr.vim') diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 03a9155512..ce1523324e 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -78,7 +78,7 @@ endfunc func Test_loop_over_null_list() let null_list = submatch(1, 1) for i in null_list - call assert_true(0, 'should not get here') + call assert_report('should not get here') endfor endfunc -- cgit