diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-26 22:36:57 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-27 21:24:59 -0500 |
commit | a3922e03a976d1623f89b07071f6a4581c84ec62 (patch) | |
tree | 82dc3000076054f785ee358db67dec32dd10fee0 | |
parent | 628a1caa692630974bceb8338eedc56ddef6cb14 (diff) | |
download | rneovim-a3922e03a976d1623f89b07071f6a4581c84ec62.tar.gz rneovim-a3922e03a976d1623f89b07071f6a4581c84ec62.tar.bz2 rneovim-a3922e03a976d1623f89b07071f6a4581c84ec62.zip |
vim-patch:8.2.0271: the "num64" feature is available everywhere
Problem: The "num64" feature is available everywhere and building without
it causes problems.
Solution: Graduage the "num64" feature. (James McCoy, closes vim/vim#5650)
https://github.com/vim/vim/commit/82f654e092ac5b86316bc1b30c0b07a849813186
Restore Test_printf_spec_b() from patch 7.4.2221..
N/A patches for version.c:
vim-patch:8.2.0594: MS-Windows: cannot build with WINVER set to 0x0501
Problem: MS-Windows: cannot build with WINVER set to 0x0501.
Solution: Only use inet_ntop() when available. (Ozaki Kiichi, closes vim/vim#5946)
https://github.com/vim/vim/commit/b6fb0516ec862a18fdffe06c9400d507a7193835
vim-patch:8.2.0965: has_funcundefined() is not used
Problem: Has_funcundefined() is not used.
Solution: Delete the function. (Dominique Pellé, closes vim/vim#6242)
https://github.com/vim/vim/commit/5055c56cfbedc6326c607d40c7a1241682f7675e
vim-patch:8.2.1370: MS-Windows: warning for using fstat() with stat_T
Problem: MS-Windows: warning for using fstat() with stat_T.
Solution: use _fstat64() if available. (Naruhiko Nishino, closes vim/vim#6625)
https://github.com/vim/vim/commit/c753478b82613df37b145764e27f5514542edb97
vim-patch:8.2.2056: configure fails when building with implicit-function-declaration
Problem: Configure fails when building with the
"implicit-function-declaration" error enabled, specifically on Mac.
Solution: Declear the functions like in the source code. (suggestion by
Clemens Lang, closes vim/vim#7380)
https://github.com/vim/vim/commit/ce7be3a0e6f19bc85990bb8fcfe5e208944777b4
-rw-r--r-- | src/nvim/strings.c | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_expr.vim | 43 | ||||
-rw-r--r-- | src/nvim/testdir/test_largefile.vim | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_sort.vim | 36 | ||||
-rw-r--r-- | src/nvim/testdir/test_vimscript.vim | 22 |
5 files changed, 49 insertions, 60 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 81a1a68a94..cb66f7682d 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -900,6 +900,7 @@ int vim_vsnprintf_typval( } switch (fmt_spec) { + case 'b': case 'B': case 'd': case 'u': case 'o': case 'x': case 'X': if (tvs && length_modifier == '\0') { length_modifier = '2'; diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index b8d6f5aa7d..7b90ba56e0 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -125,22 +125,7 @@ func Test_option_value() 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 - let set = [{"group": 1, "pattern": 2, "id": 3, "priority": 4}] - let exp = [{"group": '1', "pattern": '2', "id": 3, "priority": 4}] - if has('conceal') - let set[0]['conceal'] = 5 - let exp[0]['conceal'] = '5' - endif - call setmatches(set) - call assert_equal(exp, getmatches()) + call assert_equal("123456789012345", printf('%d', 123456789012345)) endfunc function Test_printf_spec_s() @@ -168,6 +153,19 @@ function Test_printf_spec_s() call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s']))) endfunc +function Test_printf_spec_b() + call assert_equal("0", printf('%b', 0)) + call assert_equal("00001100", printf('%08b', 12)) + call assert_equal("11111111", printf('%08b', 0xff)) + call assert_equal(" 1111011", printf('%10b', 123)) + call assert_equal("0001111011", printf('%010b', 123)) + call assert_equal(" 0b1111011", printf('%#10b', 123)) + call assert_equal("0B01111011", printf('%#010B', 123)) + call assert_equal("1001001100101100000001011010010", printf('%b', 1234567890)) + call assert_equal("11100000100100010000110000011011101111101111001", printf('%b', 123456789012345)) + call assert_equal("1111111111111111111111111111111111111111111111111111111111111111", printf('%b', -1)) +endfunc + function Test_printf_misc() call assert_equal('123', printf('123')) call assert_fails("call printf('123', 3)", "E767:") @@ -482,6 +480,19 @@ func Test_funcref() call assert_fails('let OneByRef = funcref("One", repeat(["foo"], 21))', 'E118:') endfunc +func Test_setmatches() + hi def link 1 Comment + hi def link 2 PreProc + let set = [{"group": 1, "pattern": 2, "id": 3, "priority": 4}] + let exp = [{"group": '1', "pattern": '2', "id": 3, "priority": 4}] + if has('conceal') + let set[0]['conceal'] = 5 + let exp[0]['conceal'] = '5' + endif + call setmatches(set) + call assert_equal(exp, getmatches()) +endfunc + func Test_empty_concatenate() call assert_equal('b', 'a'[4:0] . 'b') call assert_equal('b', 'b' . 'a'[4:0]) diff --git a/src/nvim/testdir/test_largefile.vim b/src/nvim/testdir/test_largefile.vim index 3f9c2dc150..fa32b7fb5c 100644 --- a/src/nvim/testdir/test_largefile.vim +++ b/src/nvim/testdir/test_largefile.vim @@ -24,11 +24,6 @@ func Test_largefile() w " Check if the file size is 4,000,000,000 bytes. let fsize=getfsize(fname) - if has('num64') - call assert_true(fsize == 4000000000) - else - " getfsize() returns -2 if a Number is 32 bits. - call assert_true(fsize == -2) - endif + call assert_true(fsize == 4000000000) call delete(fname) endfunc diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index 7da82b0185..7533eaf2e8 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -1257,9 +1257,8 @@ abc \ '2147483647'], getline(1, '$')) bwipe! - if has('num64') - new - a + new + a -9223372036854775808 -9223372036854775807 @@ -1274,22 +1273,21 @@ abc abc . - sort n - call assert_equal(['', - \ 'abc', - \ '', - \ '-9223372036854775808', - \ '-9223372036854775808', - \ '-9223372036854775807', - \ '-9223372036854775806', - \ '-1', - \ '0', - \ '1', - \ '9223372036854775806', - \ '9223372036854775807', - \ '9223372036854775807'], getline(1, '$')) - bwipe! - endif + sort n + call assert_equal(['', + \ 'abc', + \ '', + \ '-9223372036854775808', + \ '-9223372036854775808', + \ '-9223372036854775807', + \ '-9223372036854775806', + \ '-1', + \ '0', + \ '1', + \ '9223372036854775806', + \ '9223372036854775807', + \ '9223372036854775807'], getline(1, '$')) + bwipe! endfunc diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index cb81997d39..118a5dab2b 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1068,10 +1068,6 @@ endfunc "------------------------------------------------------------------------------- func Test_num64() - if !has('num64') - return - endif - call assert_notequal( 4294967296, 0) call assert_notequal(-4294967296, 0) call assert_equal( 4294967296, 0xFFFFffff + 1) @@ -1313,27 +1309,15 @@ func Test_compound_assignment_operators() " Test special cases: division or modulus with 0. let x = 1 let x /= 0 - if has('num64') - call assert_equal(0x7FFFFFFFFFFFFFFF, x) - else - call assert_equal(0x7fffffff, x) - endif + call assert_equal(0x7FFFFFFFFFFFFFFF, x) let x = -1 let x /= 0 - if has('num64') - call assert_equal(-0x7FFFFFFFFFFFFFFF, x) - else - call assert_equal(-0x7fffffff, x) - endif + call assert_equal(-0x7FFFFFFFFFFFFFFF, x) let x = 0 let x /= 0 - if has('num64') - call assert_equal(-0x7FFFFFFFFFFFFFFF - 1, x) - else - call assert_equal(-0x7FFFFFFF - 1, x) - endif + call assert_equal(-0x7FFFFFFFFFFFFFFF - 1, x) let x = 1 let x %= 0 |