To: vim_dev@googlegroups.com Subject: Patch 8.2.0183 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0183 Problem: Tests fail when the float feature is disabled. Solution: Skip tests that don't work without float support. Files: src/testdir/shared.vim, src/testdir/test_blob.vim, src/testdir/test_channel.vim, src/testdir/test_cscope.vim, src/testdir/test_execute_func.vim, src/testdir/test_expr.vim, src/testdir/test_functions.vim, src/testdir/test_lambda.vim, src/testdir/test_listdict.vim, src/testdir/test_lua.vim, src/testdir/test_options.vim, src/testdir/test_partial.vim, src/testdir/test_ruby.vim, src/testdir/test_sort.vim, src/testdir/test_timers.vim, src/testdir/test_true_false.vim, src/testdir/test_user_func.vim, src/testdir/test_vim9_expr.vim, src/testdir/test_vimscript.vim, src/testdir/test_regexp_latin.vim, src/testdir/test_glob2regpat.vim *** ../vim-8.2.0182/src/testdir/shared.vim 2019-10-20 22:25:49.000000000 +0200 --- src/testdir/shared.vim 2020-01-30 17:09:55.038803727 +0100 *************** *** 156,162 **** func s:WaitForCommon(expr, assert, timeout) " using reltime() is more accurate, but not always available let slept = 0 ! if has('reltime') let start = reltime() endif --- 156,162 ---- func s:WaitForCommon(expr, assert, timeout) " using reltime() is more accurate, but not always available let slept = 0 ! if exists('*reltimefloat') let start = reltime() endif *************** *** 181,187 **** endif sleep 10m ! if has('reltime') let slept = float2nr(reltimefloat(reltime(start)) * 1000) else let slept += 10 --- 181,187 ---- endif sleep 10m ! if exists('*reltimefloat') let slept = float2nr(reltimefloat(reltime(start)) * 1000) else let slept += 10 *************** *** 197,203 **** " feeds key-input and resumes process. Return time waited in milliseconds. " Without +timers it uses simply :sleep. func Standby(msec) ! if has('timers') let start = reltime() let g:_standby_timer = timer_start(a:msec, function('s:feedkeys')) call getchar() --- 197,203 ---- " feeds key-input and resumes process. Return time waited in milliseconds. " Without +timers it uses simply :sleep. func Standby(msec) ! if has('timers') && exists('*reltimefloat') let start = reltime() let g:_standby_timer = timer_start(a:msec, function('s:feedkeys')) call getchar() *** ../vim-8.2.0182/src/testdir/test_blob.vim 2020-01-15 20:51:31.301128122 +0100 --- src/testdir/test_blob.vim 2020-01-30 17:03:39.876198018 +0100 *************** *** 324,328 **** endfunc func Test_blob_sort() ! call assert_fails('call sort([1.0, 0z11], "f")', 'E975:') endfunc --- 324,328 ---- endfunc func Test_blob_sort() ! call assert_fails('call sort(["abc", 0z11], "f")', 'E702:') endfunc *** ../vim-8.2.0182/src/testdir/test_channel.vim 2020-01-26 21:59:25.632718110 +0100 --- src/testdir/test_channel.vim 2020-01-30 17:14:25.021776716 +0100 *************** *** 202,211 **** " Reading while there is nothing available. call assert_equal(v:none, ch_read(handle, {'timeout': 0})) ! let start = reltime() ! call assert_equal(v:none, ch_read(handle, {'timeout': 333})) ! let elapsed = reltime(start) ! call assert_inrange(0.3, 0.6, reltimefloat(reltime(start))) " Send without waiting for a response, then wait for a response. call ch_sendexpr(handle, 'wait a bit') --- 202,213 ---- " Reading while there is nothing available. call assert_equal(v:none, ch_read(handle, {'timeout': 0})) ! if exists('*reltimefloat') ! let start = reltime() ! call assert_equal(v:none, ch_read(handle, {'timeout': 333})) ! let elapsed = reltime(start) ! call assert_inrange(0.3, 0.6, reltimefloat(reltime(start))) ! endif " Send without waiting for a response, then wait for a response. call ch_sendexpr(handle, 'wait a bit') *************** *** 412,417 **** --- 414,421 ---- " Test that trying to connect to a non-existing port fails quickly. func Test_connect_waittime() + CheckFunction reltimefloat + call ch_log('Test_connect_waittime()') let start = reltime() let handle = ch_open('localhost:9876', s:chopt) *************** *** 927,932 **** --- 931,938 ---- endfunc func Test_pipe_to_buffer_json() + CheckFunction reltimefloat + let job = job_start(s:python . " test_channel_pipe.py", \ {'out_io': 'buffer', 'out_mode': 'json'}) call assert_equal("run", job_status(job)) *************** *** 1423,1428 **** --- 1429,1436 ---- endfunction func Test_exit_callback_interval() + CheckFunction reltimefloat + let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0} let job = [s:python, '-c', 'import time;time.sleep(0.5)']->job_start({'exit_cb': 'MyExitTimeCb'}) let g:exit_cb_val.process = job_info(job).process *************** *** 1768,1773 **** --- 1776,1782 ---- func Test_job_start_in_timer() CheckFeature timers + CheckFeature reltimefloat func OutCb(chan, msg) let g:val += 1 *** ../vim-8.2.0182/src/testdir/test_cscope.vim 2019-08-07 22:32:36.000000000 +0200 --- src/testdir/test_cscope.vim 2020-01-30 17:15:47.061462199 +0100 *************** *** 116,138 **** " Test 10: Invalid find command call assert_fails('cs find x', 'E560:') ! " Test 11: Find places where this symbol is assigned a value ! " this needs a cscope >= 15.8 ! " unfortunately, Travis has cscope version 15.7 ! let cscope_version = systemlist('cscope --version')[0] ! let cs_version = str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?')) ! if cs_version >= 15.8 ! for cmd in ['cs find a item', 'cs find 9 item'] ! let a = execute(cmd) ! call assert_equal(['', '(1 of 4): <> item = LALLOC_CLEAR_ONE(mf_hashitem_T);'], split(a, '\n', 1)) ! call assert_equal(' item = LALLOC_CLEAR_ONE(mf_hashitem_T);', getline('.')) ! cnext ! call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) ! cnext ! call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) ! cnext ! call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) ! endfor endif " Test 12: leading whitespace is not removed for cscope find text --- 116,140 ---- " Test 10: Invalid find command call assert_fails('cs find x', 'E560:') ! if has('float') ! " Test 11: Find places where this symbol is assigned a value ! " this needs a cscope >= 15.8 ! " unfortunately, Travis has cscope version 15.7 ! let cscope_version = systemlist('cscope --version')[0] ! let cs_version = str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?')) ! if cs_version >= 15.8 ! for cmd in ['cs find a item', 'cs find 9 item'] ! let a = execute(cmd) ! call assert_equal(['', '(1 of 4): <> item = LALLOC_CLEAR_ONE(mf_hashitem_T);'], split(a, '\n', 1)) ! call assert_equal(' item = LALLOC_CLEAR_ONE(mf_hashitem_T);', getline('.')) ! cnext ! call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) ! cnext ! call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) ! cnext ! call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) ! endfor ! endif endif " Test 12: leading whitespace is not removed for cscope find text *** ../vim-8.2.0182/src/testdir/test_execute_func.vim 2020-01-08 19:32:14.966527459 +0100 --- src/testdir/test_execute_func.vim 2020-01-30 17:17:47.604998612 +0100 *************** *** 30,43 **** call assert_equal("\nthat", evaled) call assert_fails('call execute("doesnotexist")', 'E492:') - call assert_fails('call execute(3.4)', 'E806:') call assert_fails('call execute("call NestedRedir()")', 'E930:') call assert_equal("\nsomething", execute('echo "something"', '')) call assert_equal("\nsomething", execute('echo "something"', 'silent')) call assert_equal("\nsomething", execute('echo "something"', 'silent!')) call assert_equal("", execute('burp', 'silent!')) ! call assert_fails('call execute("echo \"x\"", 3.4)', 'E806:') endfunc func Test_execute_list() --- 30,45 ---- call assert_equal("\nthat", evaled) call assert_fails('call execute("doesnotexist")', 'E492:') call assert_fails('call execute("call NestedRedir()")', 'E930:') call assert_equal("\nsomething", execute('echo "something"', '')) call assert_equal("\nsomething", execute('echo "something"', 'silent')) call assert_equal("\nsomething", execute('echo "something"', 'silent!')) call assert_equal("", execute('burp', 'silent!')) ! if has('float') ! call assert_fails('call execute(3.4)', 'E806:') ! call assert_fails('call execute("echo \"x\"", 3.4)', 'E806:') ! endif endfunc func Test_execute_list() *** ../vim-8.2.0182/src/testdir/test_expr.vim 2019-11-09 23:50:09.000000000 +0100 --- src/testdir/test_expr.vim 2020-01-30 17:18:49.648759323 +0100 *************** *** 369,375 **** call assert_fails('echo printf("%d", [])', 'E745:') call assert_fails('echo printf("%d", 1, 2)', 'E767:') call assert_fails('echo printf("%*d", 1)', 'E766:') ! call assert_fails('echo printf("%d", 1.2)', 'E805:') endfunc function Test_max_min_errors() --- 369,377 ---- call assert_fails('echo printf("%d", [])', 'E745:') call assert_fails('echo printf("%d", 1, 2)', 'E767:') call assert_fails('echo printf("%*d", 1)', 'E766:') ! if has('float') ! call assert_fails('echo printf("%d", 1.2)', 'E805:') ! endif endfunc function Test_max_min_errors() *** ../vim-8.2.0182/src/testdir/test_functions.vim 2020-01-30 14:55:29.006670423 +0100 --- src/testdir/test_functions.vim 2020-01-30 17:34:31.280885109 +0100 *************** *** 28,39 **** call assert_equal(0, empty(1)) call assert_equal(0, empty(-1)) ! call assert_equal(1, empty(0.0)) ! call assert_equal(1, empty(-0.0)) ! call assert_equal(0, empty(1.0)) ! call assert_equal(0, empty(-1.0)) ! call assert_equal(0, empty(1.0/0.0)) ! call assert_equal(0, empty(0.0/0.0)) call assert_equal(1, empty([])) call assert_equal(0, empty(['a'])) --- 28,41 ---- call assert_equal(0, empty(1)) call assert_equal(0, empty(-1)) ! if has('float') ! call assert_equal(1, empty(0.0)) ! call assert_equal(1, empty(-0.0)) ! call assert_equal(0, empty(1.0)) ! call assert_equal(0, empty(-1.0)) ! call assert_equal(0, empty(1.0/0.0)) ! call assert_equal(0, empty(0.0/0.0)) ! endif call assert_equal(1, empty([])) call assert_equal(0, empty(['a'])) *************** *** 116,122 **** call assert_fails('call strwidth({->0})', 'E729:') call assert_fails('call strwidth([])', 'E730:') call assert_fails('call strwidth({})', 'E731:') ! call assert_fails('call strwidth(1.2)', 'E806:') endfor set ambiwidth& --- 118,126 ---- call assert_fails('call strwidth({->0})', 'E729:') call assert_fails('call strwidth([])', 'E730:') call assert_fails('call strwidth({})', 'E731:') ! if has('float') ! call assert_fails('call strwidth(1.2)', 'E806:') ! endif endfor set ambiwidth& *************** *** 176,182 **** call assert_fails('call str2nr([])', 'E730:') call assert_fails('call str2nr({->2})', 'E729:') ! call assert_fails('call str2nr(1.2)', 'E806:') call assert_fails('call str2nr(10, [])', 'E474:') endfunc --- 180,188 ---- call assert_fails('call str2nr([])', 'E730:') call assert_fails('call str2nr({->2})', 'E729:') ! if has('float') ! call assert_fails('call str2nr(1.2)', 'E806:') ! endif call assert_fails('call str2nr(10, [])', 'E474:') endfunc *************** *** 422,428 **** call assert_fails('call simplify({->0})', 'E729:') call assert_fails('call simplify([])', 'E730:') call assert_fails('call simplify({})', 'E731:') ! call assert_fails('call simplify(1.2)', 'E806:') endfunc func Test_pathshorten() --- 428,436 ---- call assert_fails('call simplify({->0})', 'E729:') call assert_fails('call simplify([])', 'E730:') call assert_fails('call simplify({})', 'E731:') ! if has('float') ! call assert_fails('call simplify(1.2)', 'E806:') ! endif endfunc func Test_pathshorten() *** ../vim-8.2.0182/src/testdir/test_lambda.vim 2019-12-08 18:34:22.000000000 +0100 --- src/testdir/test_lambda.vim 2020-01-30 17:35:10.420707993 +0100 *************** *** 216,222 **** func Test_lambda_combination() call assert_equal(2, {x -> {x -> x}}(1)(2)) call assert_equal(10, {y -> {x -> x(y)(10)}({y -> y})}({z -> z})) ! call assert_equal(5.0, {x -> {y -> x / y}}(10)(2.0)) call assert_equal(6, {x -> {y -> {z -> x + y + z}}}(1)(2)(3)) call assert_equal(6, {x -> {f -> f(x)}}(3)({x -> x * 2})) --- 216,224 ---- func Test_lambda_combination() call assert_equal(2, {x -> {x -> x}}(1)(2)) call assert_equal(10, {y -> {x -> x(y)(10)}({y -> y})}({z -> z})) ! if has('float') ! call assert_equal(5.0, {x -> {y -> x / y}}(10)(2.0)) ! endif call assert_equal(6, {x -> {y -> {z -> x + y + z}}}(1)(2)(3)) call assert_equal(6, {x -> {f -> f(x)}}(3)({x -> x * 2})) *** ../vim-8.2.0182/src/testdir/test_listdict.vim 2019-08-31 21:00:20.000000000 +0200 --- src/testdir/test_listdict.vim 2020-01-30 17:42:16.126856962 +0100 *************** *** 596,613 **** call assert_equal(['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5], uniq(copy(l))) call assert_equal([1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'], reverse(l)) call assert_equal([1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'], reverse(reverse(l))) ! call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(l)) ! call assert_equal([[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'], reverse(sort(l))) ! call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(reverse(sort(l)))) ! call assert_equal(['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]], uniq(sort(l))) ! ! let l=[7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four'] ! call assert_equal([-1, 'one', 'two', 'three', 'four', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255], sort(copy(l), 'n')) ! ! let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []] ! call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 1)) ! call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i')) ! call assert_equal(['BAR', 'Bar', 'FOO', 'FOOBAR', 'Foo', 'bar', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l))) call assert_fails('call reverse("")', 'E899:') endfunc --- 596,615 ---- call assert_equal(['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5], uniq(copy(l))) call assert_equal([1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'], reverse(l)) call assert_equal([1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0'], reverse(reverse(l))) ! if has('float') ! call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(l)) ! call assert_equal([[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'], reverse(sort(l))) ! call assert_equal(['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]], sort(reverse(sort(l)))) ! call assert_equal(['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]], uniq(sort(l))) ! ! let l = [7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four'] ! call assert_equal([-1, 'one', 'two', 'three', 'four', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255], sort(copy(l), 'n')) ! ! let l = [7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []] ! call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 1)) ! call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i')) ! call assert_equal(['BAR', 'Bar', 'FOO', 'FOOBAR', 'Foo', 'bar', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l))) ! endif call assert_fails('call reverse("")', 'E899:') endfunc *************** *** 683,689 **** let l = [1, 2, 3] call assert_fails("call extend(l, [4, 5, 6], 4)", 'E684:') call assert_fails("call extend(l, [4, 5, 6], -4)", 'E684:') ! call assert_fails("call extend(l, [4, 5, 6], 1.2)", 'E805:') " Test extend() with dictionaries. --- 685,693 ---- let l = [1, 2, 3] call assert_fails("call extend(l, [4, 5, 6], 4)", 'E684:') call assert_fails("call extend(l, [4, 5, 6], -4)", 'E684:') ! if has('float') ! call assert_fails("call extend(l, [4, 5, 6], 1.2)", 'E805:') ! endif " Test extend() with dictionaries. *************** *** 707,713 **** let d = {'a': 'A', 'b': 'B'} call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 'error')", 'E737:') call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 'xxx')", 'E475:') ! call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 1.2)", 'E806:') call assert_equal({'a': 'A', 'b': 'B'}, d) call assert_fails("call extend([1, 2], 1)", 'E712:') --- 711,719 ---- let d = {'a': 'A', 'b': 'B'} call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 'error')", 'E737:') call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 'xxx')", 'E475:') ! if has('float') ! call assert_fails("call extend(d, {'b': 0, 'c':'C'}, 1.2)", 'E806:') ! endif call assert_equal({'a': 'A', 'b': 'B'}, d) call assert_fails("call extend([1, 2], 1)", 'E712:') *** ../vim-8.2.0182/src/testdir/test_lua.vim 2019-08-31 22:14:15.000000000 +0200 --- src/testdir/test_lua.vim 2020-01-30 17:50:56.556697055 +0100 *************** *** 2,7 **** --- 2,8 ---- source check.vim CheckFeature lua + CheckFeature float func TearDown() " Run garbage collection after each test to exercise luaV_setref(). *************** *** 9,15 **** endfunc " Check that switching to another buffer does not trigger ml_get error. ! func Test_command_new_no_ml_get_error() new let wincount = winnr('$') call setline(1, ['one', 'two', 'three']) --- 10,16 ---- endfunc " Check that switching to another buffer does not trigger ml_get error. ! func Test_lua_command_new_no_ml_get_error() new let wincount = winnr('$') call setline(1, ['one', 'two', 'three']) *************** *** 19,25 **** endfunc " Test vim.command() ! func Test_command() new call setline(1, ['one', 'two', 'three']) luado vim.command("1,2d_") --- 20,26 ---- endfunc " Test vim.command() ! func Test_lua_command() new call setline(1, ['one', 'two', 'three']) luado vim.command("1,2d_") *************** *** 28,34 **** endfunc " Test vim.eval() ! func Test_eval() " lua.eval with a number lua v = vim.eval('123') call assert_equal('number', luaeval('vim.type(v)')) --- 29,35 ---- endfunc " Test vim.eval() ! func Test_lua_eval() " lua.eval with a number lua v = vim.eval('123') call assert_equal('number', luaeval('vim.type(v)')) *************** *** 69,75 **** endfunc " Test vim.window() ! func Test_window() e Xfoo2 new Xfoo1 --- 70,76 ---- endfunc " Test vim.window() ! func Test_lua_window() e Xfoo2 new Xfoo1 *************** *** 85,91 **** endfunc " Test vim.window().height ! func Test_window_height() new lua vim.window().height = 2 call assert_equal(2, winheight(0)) --- 86,92 ---- endfunc " Test vim.window().height ! func Test_lua_window_height() new lua vim.window().height = 2 call assert_equal(2, winheight(0)) *************** *** 95,101 **** endfunc " Test vim.window().width ! func Test_window_width() vert new lua vim.window().width = 2 call assert_equal(2, winwidth(0)) --- 96,102 ---- endfunc " Test vim.window().width ! func Test_lua_window_width() vert new lua vim.window().width = 2 call assert_equal(2, winwidth(0)) *************** *** 105,111 **** endfunc " Test vim.window().line and vim.window.col ! func Test_window_line_col() new call setline(1, ['line1', 'line2', 'line3']) lua vim.window().line = 2 --- 106,112 ---- endfunc " Test vim.window().line and vim.window.col ! func Test_lua_window_line_col() new call setline(1, ['line1', 'line2', 'line3']) lua vim.window().line = 2 *************** *** 121,127 **** endfunc " Test setting the current window ! func Test_window_set_current() new Xfoo1 lua w1 = vim.window() new Xfoo2 --- 122,128 ---- endfunc " Test setting the current window ! func Test_lua_window_set_current() new Xfoo1 lua w1 = vim.window() new Xfoo2 *************** *** 138,144 **** endfunc " Test vim.window().buffer ! func Test_window_buffer() new Xfoo1 lua w1 = vim.window() lua b1 = w1.buffer() --- 139,145 ---- endfunc " Test vim.window().buffer ! func Test_lua_window_buffer() new Xfoo1 lua w1 = vim.window() lua b1 = w1.buffer() *************** *** 156,162 **** endfunc " Test vim.window():previous() and vim.window():next() ! func Test_window_next_previous() new Xfoo1 new Xfoo2 new Xfoo3 --- 157,163 ---- endfunc " Test vim.window():previous() and vim.window():next() ! func Test_lua_window_next_previous() new Xfoo1 new Xfoo2 new Xfoo3 *************** *** 170,176 **** endfunc " Test vim.window():isvalid() ! func Test_window_isvalid() new Xfoo lua w = vim.window() call assert_true(luaeval('w:isvalid()')) --- 171,177 ---- endfunc " Test vim.window():isvalid() ! func Test_lua_window_isvalid() new Xfoo lua w = vim.window() call assert_true(luaeval('w:isvalid()')) *************** *** 183,189 **** endfunc " Test vim.buffer() with and without argument ! func Test_buffer() new Xfoo1 let bn1 = bufnr('%') new Xfoo2 --- 184,190 ---- endfunc " Test vim.buffer() with and without argument ! func Test_lua_buffer() new Xfoo1 let bn1 = bufnr('%') new Xfoo2 *************** *** 205,211 **** endfunc " Test vim.buffer().name and vim.buffer().fname ! func Test_buffer_name() new call assert_equal('', luaeval('vim.buffer().name')) call assert_equal('', luaeval('vim.buffer().fname')) --- 206,212 ---- endfunc " Test vim.buffer().name and vim.buffer().fname ! func Test_lua_buffer_name() new call assert_equal('', luaeval('vim.buffer().name')) call assert_equal('', luaeval('vim.buffer().fname')) *************** *** 218,230 **** endfunc " Test vim.buffer().number ! func Test_buffer_number() " All numbers in Lua are floating points number (no integers). call assert_equal(bufnr('%'), float2nr(luaeval('vim.buffer().number'))) endfunc " Test inserting lines in buffer. ! func Test_buffer_insert() new lua vim.buffer()[1] = '3' lua vim.buffer():insert('1', 0) --- 219,231 ---- endfunc " Test vim.buffer().number ! func Test_lua_buffer_number() " All numbers in Lua are floating points number (no integers). call assert_equal(bufnr('%'), float2nr(luaeval('vim.buffer().number'))) endfunc " Test inserting lines in buffer. ! func Test_lua_buffer_insert() new lua vim.buffer()[1] = '3' lua vim.buffer():insert('1', 0) *************** *** 236,242 **** endfunc " Test deleting line in buffer ! func Test_buffer_delete() new call setline(1, ['1', '2', '3']) lua vim.buffer()[2] = nil --- 237,243 ---- endfunc " Test deleting line in buffer ! func Test_lua_buffer_delete() new call setline(1, ['1', '2', '3']) lua vim.buffer()[2] = nil *************** *** 248,254 **** endfunc " Test #vim.buffer() i.e. number of lines in buffer ! func Test_buffer_number_lines() new call setline(1, ['a', 'b', 'c']) call assert_equal(3.0, luaeval('#vim.buffer()')) --- 249,255 ---- endfunc " Test #vim.buffer() i.e. number of lines in buffer ! func Test_lua_buffer_number_lines() new call setline(1, ['a', 'b', 'c']) call assert_equal(3.0, luaeval('#vim.buffer()')) *************** *** 258,264 **** " Test vim.buffer():next() and vim.buffer():previous() " Note that these functions get the next or previous buffers " but do not switch buffer. ! func Test_buffer_next_previous() new Xfoo1 new Xfoo2 new Xfoo3 --- 259,265 ---- " Test vim.buffer():next() and vim.buffer():previous() " Note that these functions get the next or previous buffers " but do not switch buffer. ! func Test_lua_buffer_next_previous() new Xfoo1 new Xfoo2 new Xfoo3 *************** *** 286,292 **** endfunc " Test vim.buffer():isvalid() ! func Test_buffer_isvalid() new Xfoo lua b = vim.buffer() call assert_true(luaeval('b:isvalid()')) --- 287,293 ---- endfunc " Test vim.buffer():isvalid() ! func Test_lua_buffer_isvalid() new Xfoo lua b = vim.buffer() call assert_true(luaeval('b:isvalid()')) *************** *** 298,304 **** bwipe! endfunc ! func Test_list() call assert_equal([], luaeval('vim.list()')) let l = [] --- 299,305 ---- bwipe! endfunc ! func Test_lua_list() call assert_equal([], luaeval('vim.list()')) let l = [] *************** *** 326,332 **** lua l = nil endfunc ! func Test_list_table() " See :help lua-vim " Non-numeric keys should not be used to initialize the list " so say = 'hi' should be ignored. --- 327,333 ---- lua l = nil endfunc ! func Test_lua_list_table() " See :help lua-vim " Non-numeric keys should not be used to initialize the list " so say = 'hi' should be ignored. *************** *** 341,347 **** endfunc " Test l() i.e. iterator on list ! func Test_list_iter() lua l = vim.list():add('foo'):add('bar') lua str = '' lua for v in l() do str = str .. v end --- 342,348 ---- endfunc " Test l() i.e. iterator on list ! func Test_lua_list_iter() lua l = vim.list():add('foo'):add('bar') lua str = '' lua for v in l() do str = str .. v end *************** *** 350,356 **** lua str, l = nil endfunc ! func Test_recursive_list() lua l = vim.list():add(1):add(2) lua l = l:add(l) --- 351,357 ---- lua str, l = nil endfunc ! func Test_lua_recursive_list() lua l = vim.list():add(1):add(2) lua l = l:add(l) *************** *** 374,380 **** lua l = nil endfunc ! func Test_dict() call assert_equal({}, luaeval('vim.dict()')) let d = {} --- 375,381 ---- lua l = nil endfunc ! func Test_lua_dict() call assert_equal({}, luaeval('vim.dict()')) let d = {} *************** *** 401,407 **** lua d = nil endfunc ! func Test_dict_table() lua t = {key1 = 'x', key2 = 3.14, key3 = true, key4 = false} call assert_equal({'key1': 'x', 'key2': 3.14, 'key3': v:true, 'key4': v:false}, \ luaeval('vim.dict(t)')) --- 402,408 ---- lua d = nil endfunc ! func Test_lua_dict_table() lua t = {key1 = 'x', key2 = 3.14, key3 = true, key4 = false} call assert_equal({'key1': 'x', 'key2': 3.14, 'key3': v:true, 'key4': v:false}, \ luaeval('vim.dict(t)')) *************** *** 422,428 **** endfunc " Test d() i.e. iterator on dictionary ! func Test_dict_iter() let d = {'a': 1, 'b':2} lua d = vim.eval('d') lua str = '' --- 423,429 ---- endfunc " Test d() i.e. iterator on dictionary ! func Test_lua_dict_iter() let d = {'a': 1, 'b':2} lua d = vim.eval('d') lua str = '' *************** *** 432,438 **** lua str, d = nil endfunc ! func Test_blob() call assert_equal(0z, luaeval('vim.blob("")')) call assert_equal(0z31326162, luaeval('vim.blob("12ab")')) call assert_equal(0z00010203, luaeval('vim.blob("\x00\x01\x02\x03")')) --- 433,439 ---- lua str, d = nil endfunc ! func Test_lua_blob() call assert_equal(0z, luaeval('vim.blob("")')) call assert_equal(0z31326162, luaeval('vim.blob("12ab")')) call assert_equal(0z00010203, luaeval('vim.blob("\x00\x01\x02\x03")')) *************** *** 456,462 **** lua b = nil endfunc ! func Test_funcref() function I(x) return a:x endfunction --- 457,463 ---- lua b = nil endfunc ! func Test_lua_funcref() function I(x) return a:x endfunction *************** *** 483,489 **** endfunc " Test vim.type() ! func Test_type() " The following values are identical to Lua's type function. call assert_equal('string', luaeval('vim.type("foo")')) call assert_equal('number', luaeval('vim.type(1)')) --- 484,490 ---- endfunc " Test vim.type() ! func Test_lua_type() " The following values are identical to Lua's type function. call assert_equal('string', luaeval('vim.type("foo")')) call assert_equal('number', luaeval('vim.type(1)')) *************** *** 503,509 **** endfunc " Test vim.open() ! func Test_open() call assert_notmatch('XOpen', execute('ls')) " Open a buffer XOpen1, but do not jump to it. --- 504,510 ---- endfunc " Test vim.open() ! func Test_lua_open() call assert_notmatch('XOpen', execute('ls')) " Open a buffer XOpen1, but do not jump to it. *************** *** 524,530 **** endfunc " Test vim.line() ! func Test_line() new call setline(1, ['first line', 'second line']) 1 --- 525,531 ---- endfunc " Test vim.line() ! func Test_lua_line() new call setline(1, ['first line', 'second line']) 1 *************** *** 535,541 **** endfunc " Test vim.beep() ! func Test_beep() call assert_beeps('lua vim.beep()') endfunc --- 536,542 ---- endfunc " Test vim.beep() ! func Test_lua_beep() call assert_beeps('lua vim.beep()') endfunc *************** *** 591,597 **** bwipe! endfunc ! func Test_set_cursor() " Check that setting the cursor position works. new call setline(1, ['first line', 'second line']) --- 592,598 ---- bwipe! endfunc ! func Test_lua_set_cursor() " Check that setting the cursor position works. new call setline(1, ['first line', 'second line']) *** ../vim-8.2.0182/src/testdir/test_options.vim 2020-01-29 21:57:28.745607653 +0100 --- src/testdir/test_options.vim 2020-01-30 17:51:57.148449419 +0100 *************** *** 615,623 **** endfunc func Test_writedelay() ! if !has('reltime') ! return ! endif new call setline(1, 'empty') redraw --- 615,622 ---- endfunc func Test_writedelay() ! CheckFunction reltimefloat ! new call setline(1, 'empty') redraw *** ../vim-8.2.0182/src/testdir/test_partial.vim 2019-07-28 13:16:47.000000000 +0200 --- src/testdir/test_partial.vim 2020-01-30 17:53:38.784035016 +0100 *************** *** 106,112 **** endfu fun OuterCall() ! let opt = { 'func' : function('sin') } call InnerCall(opt.func) endfu --- 106,112 ---- endfu fun OuterCall() ! let opt = { 'func' : function('max') } call InnerCall(opt.func) endfu *** ../vim-8.2.0182/src/testdir/test_ruby.vim 2019-09-04 22:26:26.000000000 +0200 --- src/testdir/test_ruby.vim 2020-01-30 17:55:32.443572828 +0100 *************** *** 34,40 **** call delete(tempfile) endfunc ! func Test_set_cursor() " Check that setting the cursor position works. new call setline(1, ['first line', 'second line']) --- 34,40 ---- call delete(tempfile) endfunc ! func Test_ruby_set_cursor() " Check that setting the cursor position works. new call setline(1, ['first line', 'second line']) *************** *** 54,60 **** endfunc " Test buffer.count and buffer.length (number of lines in buffer) ! func Test_buffer_count() new call setline(1, ['one', 'two', 'three']) call assert_equal(3, rubyeval('$curbuf.count')) --- 54,60 ---- endfunc " Test buffer.count and buffer.length (number of lines in buffer) ! func Test_ruby_buffer_count() new call setline(1, ['one', 'two', 'three']) call assert_equal(3, rubyeval('$curbuf.count')) *************** *** 63,69 **** endfunc " Test buffer.name (buffer name) ! func Test_buffer_name() new Xfoo call assert_equal(expand('%:p'), rubyeval('$curbuf.name')) bwipe --- 63,69 ---- endfunc " Test buffer.name (buffer name) ! func Test_ruby_buffer_name() new Xfoo call assert_equal(expand('%:p'), rubyeval('$curbuf.name')) bwipe *************** *** 71,77 **** endfunc " Test buffer.number (number of the buffer). ! func Test_buffer_number() new call assert_equal(bufnr('%'), rubyeval('$curbuf.number')) new --- 71,77 ---- endfunc " Test buffer.number (number of the buffer). ! func Test_ruby_buffer_number() new call assert_equal(bufnr('%'), rubyeval('$curbuf.number')) new *************** *** 81,87 **** endfunc " Test buffer.delete({n}) (delete line {n}) ! func Test_buffer_delete() new call setline(1, ['one', 'two', 'three']) ruby $curbuf.delete(2) --- 81,87 ---- endfunc " Test buffer.delete({n}) (delete line {n}) ! func Test_ruby_buffer_delete() new call setline(1, ['one', 'two', 'three']) ruby $curbuf.delete(2) *************** *** 94,100 **** endfunc " Test buffer.append({str}, str) (append line {str} after line {n}) ! func Test_buffer_append() new ruby $curbuf.append(0, 'one') ruby $curbuf.append(1, 'three') --- 94,100 ---- endfunc " Test buffer.append({str}, str) (append line {str} after line {n}) ! func Test_ruby_buffer_append() new ruby $curbuf.append(0, 'one') ruby $curbuf.append(1, 'three') *************** *** 112,118 **** endfunc " Test buffer.line (get or set the current line) ! func Test_buffer_line() new call setline(1, ['one', 'two', 'three']) 2 --- 112,118 ---- endfunc " Test buffer.line (get or set the current line) ! func Test_ruby_buffer_line() new call setline(1, ['one', 'two', 'three']) 2 *************** *** 125,131 **** endfunc " Test buffer.line_number (get current line number) ! func Test_buffer_line_number() new call setline(1, ['one', 'two', 'three']) 2 --- 125,131 ---- endfunc " Test buffer.line_number (get current line number) ! func Test_ruby_buffer_line_number() new call setline(1, ['one', 'two', 'three']) 2 *************** *** 134,140 **** bwipe! endfunc ! func Test_buffer_get() new call setline(1, ['one', 'two']) call assert_equal('one', rubyeval('$curbuf[1]')) --- 134,140 ---- bwipe! endfunc ! func Test_ruby_buffer_get() new call setline(1, ['one', 'two']) call assert_equal('one', rubyeval('$curbuf[1]')) *************** *** 148,154 **** bwipe! endfunc ! func Test_buffer_set() new call setline(1, ['one', 'two']) ruby $curbuf[2] = 'TWO' --- 148,154 ---- bwipe! endfunc ! func Test_ruby_buffer_set() new call setline(1, ['one', 'two']) ruby $curbuf[2] = 'TWO' *************** *** 162,168 **** endfunc " Test window.width (get or set window height). ! func Test_window_height() new " Test setting window height --- 162,168 ---- endfunc " Test window.width (get or set window height). ! func Test_ruby_window_height() new " Test setting window height *************** *** 176,182 **** endfunc " Test window.width (get or set window width). ! func Test_window_width() vnew " Test setting window width --- 176,182 ---- endfunc " Test window.width (get or set window width). ! func Test_ruby_window_width() vnew " Test setting window width *************** *** 190,196 **** endfunc " Test window.buffer (get buffer object of a window object). ! func Test_window_buffer() new Xfoo1 new Xfoo2 ruby $b2 = $curwin.buffer --- 190,196 ---- endfunc " Test window.buffer (get buffer object of a window object). ! func Test_ruby_window_buffer() new Xfoo1 new Xfoo2 ruby $b2 = $curwin.buffer *************** *** 209,222 **** endfunc " Test Vim::Window.current (get current window object) ! func Test_Vim_window_current() let cw = rubyeval('$curwin') call assert_equal(cw, rubyeval('Vim::Window.current')) call assert_match('^#$', cw) endfunc " Test Vim::Window.count (number of windows) ! func Test_Vim_window_count() new Xfoo1 new Xfoo2 split --- 209,222 ---- endfunc " Test Vim::Window.current (get current window object) ! func Test_ruby_Vim_window_current() let cw = rubyeval('$curwin') call assert_equal(cw, rubyeval('Vim::Window.current')) call assert_match('^#$', cw) endfunc " Test Vim::Window.count (number of windows) ! func Test_ruby_Vim_window_count() new Xfoo1 new Xfoo2 split *************** *** 226,232 **** endfunc " Test Vim::Window[n] (get window object of window n) ! func Test_Vim_window_get() new Xfoo1 new Xfoo2 call assert_match('Xfoo2$', rubyeval('Vim::Window[0].buffer.name')) --- 226,232 ---- endfunc " Test Vim::Window[n] (get window object of window n) ! func Test_ruby_Vim_window_get() new Xfoo1 new Xfoo2 call assert_match('Xfoo2$', rubyeval('Vim::Window[0].buffer.name')) *************** *** 238,251 **** endfunc " Test Vim::Buffer.current (return the buffer object of current buffer) ! func Test_Vim_buffer_current() let cb = rubyeval('$curbuf') call assert_equal(cb, rubyeval('Vim::Buffer.current')) call assert_match('^#$', cb) endfunc " Test Vim::Buffer:.count (return the number of buffers) ! func Test_Vim_buffer_count() new Xfoo1 new Xfoo2 call assert_equal(3, rubyeval('Vim::Buffer.count')) --- 238,251 ---- endfunc " Test Vim::Buffer.current (return the buffer object of current buffer) ! func Test_ruby_Vim_buffer_current() let cb = rubyeval('$curbuf') call assert_equal(cb, rubyeval('Vim::Buffer.current')) call assert_match('^#$', cb) endfunc " Test Vim::Buffer:.count (return the number of buffers) ! func Test_ruby_Vim_buffer_count() new Xfoo1 new Xfoo2 call assert_equal(3, rubyeval('Vim::Buffer.count')) *************** *** 254,260 **** endfunc " Test Vim::buffer[n] (return the buffer object of buffer number n) ! func Test_Vim_buffer_get() new Xfoo1 new Xfoo2 --- 254,260 ---- endfunc " Test Vim::buffer[n] (return the buffer object of buffer number n) ! func Test_ruby_Vim_buffer_get() new Xfoo1 new Xfoo2 *************** *** 269,275 **** " Test Vim::command({cmd}) (execute a Ex command)) " Test Vim::command({cmd}) ! func Test_Vim_command() new call setline(1, ['one', 'two', 'three', 'four']) ruby Vim::command('2,3d') --- 269,275 ---- " Test Vim::command({cmd}) (execute a Ex command)) " Test Vim::command({cmd}) ! func Test_ruby_Vim_command() new call setline(1, ['one', 'two', 'three', 'four']) ruby Vim::command('2,3d') *************** *** 278,284 **** endfunc " Test Vim::set_option (set a vim option) ! func Test_Vim_set_option() call assert_equal(0, &number) ruby Vim::set_option('number') call assert_equal(1, &number) --- 278,284 ---- endfunc " Test Vim::set_option (set a vim option) ! func Test_ruby_Vim_set_option() call assert_equal(0, &number) ruby Vim::set_option('number') call assert_equal(1, &number) *************** *** 286,299 **** call assert_equal(0, &number) endfunc ! func Test_Vim_evaluate() call assert_equal(123, rubyeval('Vim::evaluate("123")')) " Vim::evaluate("123").class gives Integer or Fixnum depending " on versions of Ruby. call assert_match('^Integer\|Fixnum$', rubyeval('Vim::evaluate("123").class')) ! call assert_equal(1.23, rubyeval('Vim::evaluate("1.23")')) ! call assert_equal('Float', rubyeval('Vim::evaluate("1.23").class')) call assert_equal('foo', rubyeval('Vim::evaluate("\"foo\"")')) call assert_equal('String', rubyeval('Vim::evaluate("\"foo\"").class')) --- 286,301 ---- call assert_equal(0, &number) endfunc ! func Test_ruby_Vim_evaluate() call assert_equal(123, rubyeval('Vim::evaluate("123")')) " Vim::evaluate("123").class gives Integer or Fixnum depending " on versions of Ruby. call assert_match('^Integer\|Fixnum$', rubyeval('Vim::evaluate("123").class')) ! if has('float') ! call assert_equal(1.23, rubyeval('Vim::evaluate("1.23")')) ! call assert_equal('Float', rubyeval('Vim::evaluate("1.23").class')) ! endif call assert_equal('foo', rubyeval('Vim::evaluate("\"foo\"")')) call assert_equal('String', rubyeval('Vim::evaluate("\"foo\"").class')) *************** *** 319,332 **** call assert_equal('FalseClass',rubyeval('Vim::evaluate("v:false").class')) endfunc ! func Test_Vim_blob() call assert_equal('0z', rubyeval('Vim::blob("")')) call assert_equal('0z31326162', rubyeval('Vim::blob("12ab")')) call assert_equal('0z00010203', rubyeval('Vim::blob("\x00\x01\x02\x03")')) call assert_equal('0z8081FEFF', rubyeval('Vim::blob("\x80\x81\xfe\xff")')) endfunc ! func Test_Vim_evaluate_list() call setline(line('$'), ['2 line 2']) ruby Vim.command("normal /^2\n") let l = ["abc", "def"] --- 321,334 ---- call assert_equal('FalseClass',rubyeval('Vim::evaluate("v:false").class')) endfunc ! func Test_ruby_Vim_blob() call assert_equal('0z', rubyeval('Vim::blob("")')) call assert_equal('0z31326162', rubyeval('Vim::blob("12ab")')) call assert_equal('0z00010203', rubyeval('Vim::blob("\x00\x01\x02\x03")')) call assert_equal('0z8081FEFF', rubyeval('Vim::blob("\x80\x81\xfe\xff")')) endfunc ! func Test_ruby_Vim_evaluate_list() call setline(line('$'), ['2 line 2']) ruby Vim.command("normal /^2\n") let l = ["abc", "def"] *************** *** 340,346 **** call assert_equal('abc/def', getline('$')) endfunc ! func Test_Vim_evaluate_dict() let d = {'a': 'foo', 'b': 123} redir => l:out ruby d = Vim.evaluate("d"); print d --- 342,348 ---- call assert_equal('abc/def', getline('$')) endfunc ! func Test_ruby_Vim_evaluate_dict() let d = {'a': 'foo', 'b': 123} redir => l:out ruby d = Vim.evaluate("d"); print d *************** *** 349,361 **** endfunc " Test Vim::message({msg}) (display message {msg}) ! func Test_Vim_message() ruby Vim::message('A message') let messages = split(execute('message'), "\n") call assert_equal('A message', messages[-1]) endfunc ! func Test_print() func RubyPrint(expr) return trim(execute('ruby print ' . a:expr)) endfunc --- 351,363 ---- endfunc " Test Vim::message({msg}) (display message {msg}) ! func Test_ruby_Vim_message() ruby Vim::message('A message') let messages = split(execute('message'), "\n") call assert_equal('A message', messages[-1]) endfunc ! func Test_ruby_print() func RubyPrint(expr) return trim(execute('ruby print ' . a:expr)) endfunc *************** *** 374,380 **** delfunc RubyPrint endfunc ! func Test_p() ruby p 'Just a test' let messages = split(execute('message'), "\n") call assert_equal('"Just a test"', messages[-1]) --- 376,382 ---- delfunc RubyPrint endfunc ! func Test_ruby_p() ruby p 'Just a test' let messages = split(execute('message'), "\n") call assert_equal('"Just a test"', messages[-1]) *** ../vim-8.2.0182/src/testdir/test_sort.vim 2020-01-29 21:57:28.745607653 +0100 --- src/testdir/test_sort.vim 2020-01-30 17:59:42.578559321 +0100 *************** *** 1,5 **** --- 1,7 ---- " Tests for the "sort()" function and for the ":sort" command. + source check.vim + func Compare1(a, b) abort call sort(range(3), 'Compare2') return a:a - a:b *************** *** 28,33 **** --- 30,36 ---- endfunc func Test_sort_float() + CheckFeature float call assert_equal([0.28, 3, 13.5], sort([13.5, 0.28, 3], 'f')) endfunc *************** *** 37,42 **** --- 40,47 ---- endfunc func Test_sort_default() + CheckFeature float + " docs say omitted, empty or zero argument sorts on string representation. call assert_equal(['2', 'A', 'AA', 'a', 1, 3.3], sort([3.3, 1, "2", "A", "a", "AA"])) call assert_equal(['2', 'A', 'AA', 'a', 1, 3.3], sort([3.3, 1, "2", "A", "a", "AA"], '')) *************** *** 1145,1174 **** \ ] \ }, \ { - \ 'name' : 'float', - \ 'cmd' : 'sort f', - \ 'input' : [ - \ '1.234', - \ '0.88', - \ ' + 123.456', - \ '1.15e-6', - \ '-1.1e3', - \ '-1.01e3', - \ '', - \ '' - \ ], - \ 'expected' : [ - \ '', - \ '', - \ '-1.1e3', - \ '-1.01e3', - \ '1.15e-6', - \ '0.88', - \ '1.234', - \ ' + 123.456' - \ ] - \ }, - \ { \ 'name' : 'alphabetical, sorted input', \ 'cmd' : 'sort', \ 'input' : [ --- 1150,1155 ---- *************** *** 1223,1228 **** --- 1204,1238 ---- \ }, \ ] + if has('float') + let tests += [ + \ { + \ 'name' : 'float', + \ 'cmd' : 'sort f', + \ 'input' : [ + \ '1.234', + \ '0.88', + \ ' + 123.456', + \ '1.15e-6', + \ '-1.1e3', + \ '-1.01e3', + \ '', + \ '' + \ ], + \ 'expected' : [ + \ '', + \ '', + \ '-1.1e3', + \ '-1.01e3', + \ '1.15e-6', + \ '0.88', + \ '1.234', + \ ' + 123.456' + \ ] + \ }, + \ ] + endif + for t in tests enew! call append(0, t.input) *** ../vim-8.2.0182/src/testdir/test_timers.vim 2019-12-27 17:14:28.939200621 +0100 --- src/testdir/test_timers.vim 2020-01-30 18:00:43.286313901 +0100 *************** *** 290,295 **** --- 290,296 ---- if has('win32') && !has('gui_running') throw 'Skipped: cannot get low-level input' endif + CheckFunction reltimefloat " Measure the elapsed time to avoid a hang when it fails. let start = reltime() *** ../vim-8.2.0182/src/testdir/test_true_false.vim 2019-08-31 20:26:06.000000000 +0200 --- src/testdir/test_true_false.vim 2020-01-30 18:02:24.989903121 +0100 *************** *** 1,5 **** --- 1,7 ---- " Test behavior of boolean-like values. + source check.vim + " Test what is explained at ":help TRUE" and ":help FALSE". func Test_if() if v:false *************** *** 41,47 **** call assert_fails('if [1]', 'E745') call assert_fails('if {1: 1}', 'E728') call assert_fails('if function("string")', 'E703') ! call assert_fails('if 1.3")', 'E805') endfunc function Try_arg_true_false(expr, false_val, true_val) --- 43,51 ---- call assert_fails('if [1]', 'E745') call assert_fails('if {1: 1}', 'E728') call assert_fails('if function("string")', 'E703') ! if has('float') ! call assert_fails('if 1.3")', 'E805') ! endif endfunc function Try_arg_true_false(expr, false_val, true_val) *************** *** 113,118 **** --- 117,123 ---- endfunc function Try_arg_non_zero(expr, false_val, true_val) + CheckFeature float for v in ['v:false', '0', '[1]', '{2:3}', '3.4'] let r = eval(substitute(a:expr, '%v%', v, '')) call assert_equal(a:false_val, r, 'result for ' . v . ' is not ' . a:false_val . ' but ' . r) *** ../vim-8.2.0182/src/testdir/test_user_func.vim 2019-08-04 22:39:19.000000000 +0200 --- src/testdir/test_user_func.vim 2020-01-30 18:03:55.897536222 +0100 *************** *** 121,129 **** endfunc func Test_default_arg() ! call assert_equal(1.0, Log(10)) ! call assert_equal(log(10), Log(10, exp(1))) ! call assert_fails("call Log(1,2,3)", 'E118') let res = Args(1) call assert_equal(res.mandatory, 1) --- 121,131 ---- endfunc func Test_default_arg() ! if has('float') ! call assert_equal(1.0, Log(10)) ! call assert_equal(log(10), Log(10, exp(1))) ! call assert_fails("call Log(1,2,3)", 'E118') ! endif let res = Args(1) call assert_equal(res.mandatory, 1) *** ../vim-8.2.0182/src/testdir/test_vim9_expr.vim 2020-01-28 22:52:44.761131303 +0100 --- src/testdir/test_vim9_expr.vim 2020-01-30 18:04:49.813364178 +0100 *************** *** 19,25 **** def Test_expr1() assert_equal('one', true ? 'one' : 'two') assert_equal('one', 1 ? 'one' : 'two') ! assert_equal('one', 0.1 ? 'one' : 'two') assert_equal('one', 'x' ? 'one' : 'two') " assert_equal('one', 0z1234 ? 'one' : 'two') assert_equal('one', [0] ? 'one' : 'two') --- 19,27 ---- def Test_expr1() assert_equal('one', true ? 'one' : 'two') assert_equal('one', 1 ? 'one' : 'two') ! if has('float') ! assert_equal('one', 0.1 ? 'one' : 'two') ! endif assert_equal('one', 'x' ? 'one' : 'two') " assert_equal('one', 0z1234 ? 'one' : 'two') assert_equal('one', [0] ? 'one' : 'two') *** ../vim-8.2.0182/src/testdir/test_vimscript.vim 2020-01-02 14:31:17.944876303 +0100 --- src/testdir/test_vimscript.vim 2020-01-30 18:09:10.828565056 +0100 *************** *** 1142,1148 **** call assert_equal(2, type(function("tr", [8]))) call assert_equal(3, type([])) call assert_equal(4, type({})) ! call assert_equal(5, type(0.0)) call assert_equal(6, type(v:false)) call assert_equal(6, type(v:true)) call assert_equal(7, type(v:none)) --- 1142,1150 ---- call assert_equal(2, type(function("tr", [8]))) call assert_equal(3, type([])) call assert_equal(4, type({})) ! if has('float') ! call assert_equal(5, type(0.0)) ! endif call assert_equal(6, type(v:false)) call assert_equal(6, type(v:true)) call assert_equal(7, type(v:none)) *************** *** 1155,1161 **** call assert_equal(v:t_func, type(function("tr", [8]))) call assert_equal(v:t_list, type([])) call assert_equal(v:t_dict, type({})) ! call assert_equal(v:t_float, type(0.0)) call assert_equal(v:t_bool, type(v:false)) call assert_equal(v:t_bool, type(v:true)) call assert_equal(v:t_none, type(v:none)) --- 1157,1165 ---- call assert_equal(v:t_func, type(function("tr", [8]))) call assert_equal(v:t_list, type([])) call assert_equal(v:t_dict, type({})) ! if has('float') ! call assert_equal(v:t_float, type(0.0)) ! endif call assert_equal(v:t_bool, type(v:false)) call assert_equal(v:t_bool, type(v:true)) call assert_equal(v:t_none, type(v:none)) *************** *** 1425,1432 **** call assert_equal(-9223372036854775807, -1 / 0) call assert_equal(-9223372036854775807 - 1, 0 / 0) ! call assert_equal( 0x7FFFffffFFFFffff, float2nr( 1.0e150)) ! call assert_equal(-0x7FFFffffFFFFffff, float2nr(-1.0e150)) let rng = range(0xFFFFffff, 0x100000001) call assert_equal([0xFFFFffff, 0x100000000, 0x100000001], rng) --- 1429,1438 ---- call assert_equal(-9223372036854775807, -1 / 0) call assert_equal(-9223372036854775807 - 1, 0 / 0) ! if has('float') ! call assert_equal( 0x7FFFffffFFFFffff, float2nr( 1.0e150)) ! call assert_equal(-0x7FFFffffFFFFffff, float2nr(-1.0e150)) ! endif let rng = range(0xFFFFffff, 0x100000001) call assert_equal([0xFFFFffff, 0x100000000, 0x100000001], rng) *************** *** 1526,1535 **** call assert_equal(16, and(127, 16)) eval 127->and(16)->assert_equal(16) call assert_equal(0, and(127, 128)) - call assert_fails("call and(1.0, 1)", 'E805:') call assert_fails("call and([], 1)", 'E745:') call assert_fails("call and({}, 1)", 'E728:') ! call assert_fails("call and(1, 1.0)", 'E805:') call assert_fails("call and(1, [])", 'E745:') call assert_fails("call and(1, {})", 'E728:') " or --- 1532,1543 ---- call assert_equal(16, and(127, 16)) eval 127->and(16)->assert_equal(16) call assert_equal(0, and(127, 128)) call assert_fails("call and([], 1)", 'E745:') call assert_fails("call and({}, 1)", 'E728:') ! if has('float') ! call assert_fails("call and(1.0, 1)", 'E805:') ! call assert_fails("call and(1, 1.0)", 'E805:') ! endif call assert_fails("call and(1, [])", 'E745:') call assert_fails("call and(1, {})", 'E728:') " or *************** *** 1537,1546 **** call assert_equal(15, or(8, 7)) eval 8->or(7)->assert_equal(15) call assert_equal(123, or(0, 123)) - call assert_fails("call or(1.0, 1)", 'E805:') call assert_fails("call or([], 1)", 'E745:') call assert_fails("call or({}, 1)", 'E728:') ! call assert_fails("call or(1, 1.0)", 'E805:') call assert_fails("call or(1, [])", 'E745:') call assert_fails("call or(1, {})", 'E728:') " xor --- 1545,1556 ---- call assert_equal(15, or(8, 7)) eval 8->or(7)->assert_equal(15) call assert_equal(123, or(0, 123)) call assert_fails("call or([], 1)", 'E745:') call assert_fails("call or({}, 1)", 'E728:') ! if has('float') ! call assert_fails("call or(1.0, 1)", 'E805:') ! call assert_fails("call or(1, 1.0)", 'E805:') ! endif call assert_fails("call or(1, [])", 'E745:') call assert_fails("call or(1, {})", 'E728:') " xor *************** *** 1548,1557 **** call assert_equal(111, xor(127, 16)) eval 127->xor(16)->assert_equal(111) call assert_equal(255, xor(127, 128)) ! call assert_fails("call xor(1.0, 1)", 'E805:') call assert_fails("call xor([], 1)", 'E745:') call assert_fails("call xor({}, 1)", 'E728:') - call assert_fails("call xor(1, 1.0)", 'E805:') call assert_fails("call xor(1, [])", 'E745:') call assert_fails("call xor(1, {})", 'E728:') " invert --- 1558,1569 ---- call assert_equal(111, xor(127, 16)) eval 127->xor(16)->assert_equal(111) call assert_equal(255, xor(127, 128)) ! if has('float') ! call assert_fails("call xor(1.0, 1)", 'E805:') ! call assert_fails("call xor(1, 1.0)", 'E805:') ! endif call assert_fails("call xor([], 1)", 'E745:') call assert_fails("call xor({}, 1)", 'E728:') call assert_fails("call xor(1, [])", 'E745:') call assert_fails("call xor(1, {})", 'E728:') " invert *************** *** 1559,1565 **** eval 127->invert()->and(65535)->assert_equal(65408) call assert_equal(65519, and(invert(16), 65535)) call assert_equal(65407, and(invert(128), 65535)) ! call assert_fails("call invert(1.0)", 'E805:') call assert_fails("call invert([])", 'E745:') call assert_fails("call invert({})", 'E728:') endfunc --- 1571,1579 ---- eval 127->invert()->and(65535)->assert_equal(65408) call assert_equal(65519, and(invert(16), 65535)) call assert_equal(65407, and(invert(128), 65535)) ! if has('float') ! call assert_fails("call invert(1.0)", 'E805:') ! endif call assert_fails("call invert([])", 'E745:') call assert_fails("call invert({})", 'E728:') endfunc *************** *** 1718,1739 **** call assert_equal('string', x) let x += 1 call assert_equal(1, x) - let x -= 1.5 - call assert_equal(-0.5, x) if has('float') ! " Test for float ! let x = 0.5 ! let x += 4.5 ! call assert_equal(5.0, x) ! let x -= 1.5 ! call assert_equal(3.5, x) ! let x *= 3.0 ! call assert_equal(10.5, x) ! let x /= 2.5 ! call assert_equal(4.2, x) ! call assert_fails('let x %= 0.5', 'E734') ! call assert_fails('let x .= "f"', 'E734') endif " Test for environment variable --- 1732,1753 ---- call assert_equal('string', x) let x += 1 call assert_equal(1, x) if has('float') ! " Test for float ! let x -= 1.5 ! call assert_equal(-0.5, x) ! let x = 0.5 ! let x += 4.5 ! call assert_equal(5.0, x) ! let x -= 1.5 ! call assert_equal(3.5, x) ! let x *= 3.0 ! call assert_equal(10.5, x) ! let x /= 2.5 ! call assert_equal(4.2, x) ! call assert_fails('let x %= 0.5', 'E734') ! call assert_fails('let x .= "f"', 'E734') endif " Test for environment variable *** ../vim-8.2.0182/src/testdir/test_regexp_latin.vim 2019-12-15 13:39:09.941980957 +0100 --- src/testdir/test_regexp_latin.vim 2020-01-30 18:10:47.760244405 +0100 *************** *** 2,7 **** --- 2,9 ---- set encoding=latin1 scriptencoding latin1 + source check.vim + func s:equivalence_test() let str = "AÀÁÂÃÄÅ B C D EÈÉÊË F G H IÌÍÎÏ J K L M NÑ OÒÓÔÕÖØ P Q R S T UÙÚÛÜ V W X YÝ Z aàáâãäå b c d eèéêë f g h iìíîï j k l m nñ oòóôõöø p q r s t uùúûü v w x yýÿ z" let groups = split(str) *************** *** 132,140 **** endfunc func Test_pattern_compile_speed() ! if !exists('+spellcapcheck') || !has('reltime') ! return ! endif let start = reltime() " this used to be very slow, not it should be about a second set spc=\\v(((((Nxxxxxxx&&xxxx){179})+)+)+){179} --- 134,142 ---- endfunc func Test_pattern_compile_speed() ! CheckOption spellcapcheck ! CheckFunction reltimefloat ! let start = reltime() " this used to be very slow, not it should be about a second set spc=\\v(((((Nxxxxxxx&&xxxx){179})+)+)+){179} *** ../vim-8.2.0182/src/testdir/test_glob2regpat.vim 2019-08-31 19:04:32.000000000 +0200 --- src/testdir/test_glob2regpat.vim 2020-01-30 18:17:39.150795513 +0100 *************** *** 1,7 **** " Test glob2regpat() func Test_glob2regpat_invalid() ! call assert_fails('call glob2regpat(1.33)', 'E806:') call assert_fails('call glob2regpat("}")', 'E219:') call assert_fails('call glob2regpat("{")', 'E220:') endfunc --- 1,9 ---- " Test glob2regpat() func Test_glob2regpat_invalid() ! if has('float') ! call assert_fails('call glob2regpat(1.33)', 'E806:') ! endif call assert_fails('call glob2regpat("}")', 'E219:') call assert_fails('call glob2regpat("{")', 'E220:') endfunc *** ../vim-8.2.0182/src/version.c 2020-01-30 16:40:07.653560032 +0100 --- src/version.c 2020-01-30 18:20:07.190251250 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 183, /**/ -- hundred-and-one symptoms of being an internet addict: 21. Your dog has its own home page. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///