From 75119fcc86e055895af824f7fdbba2f42c1cbbe8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 May 2023 07:02:43 +0800 Subject: vim-patch:8.2.3135: Vim9: builtin function arguments not checked at compile time Problem: Vim9: builtin function arguments not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes vim/vim#8539) https://github.com/vim/vim/commit/5b73992d8f82be7ac4b6f46c17f53ffb9640e5fa Co-authored-by: Yegappan Lakshmanan --- test/functional/vimscript/execute_spec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/vimscript/execute_spec.lua') diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index 5fe3d787cb..b9893a5150 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -95,15 +95,15 @@ describe('execute()', function() ret = exc_exec('call execute(0.0)') eq('Vim(call):E806: using Float as a String', ret) ret = exc_exec('call execute(v:_null_dict)') - eq('Vim(call):E731: using Dictionary as a String', ret) + eq('Vim(call):E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(function("tr"))') - eq('Vim(call):E729: using Funcref as a String', ret) + eq('Vim(call):E729: Using a Funcref as a String', ret) ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])') eq('Vim:E806: using Float as a String', ret) ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])') - eq('Vim:E731: using Dictionary as a String', ret) + eq('Vim:E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])') - eq('Vim:E729: using Funcref as a String', ret) + eq('Vim:E729: Using a Funcref as a String', ret) end) it('captures output with highlights', function() @@ -325,7 +325,7 @@ describe('execute()', function() eq('Vim(call):E806: using Float as a String', ret) ret = exc_exec('call execute(v:_null_dict, "silent")') - eq('Vim(call):E731: using Dictionary as a String', ret) + eq('Vim(call):E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute("echo add(1, 1)", "")') eq('Vim(echo):E897: List or Blob required', ret) -- cgit From 88cfb49bee3c9102082c7010acb92244e4ad1348 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 May 2023 07:14:39 +0800 Subject: vim-patch:8.2.4890: inconsistent capitalization in error messages Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar --- test/functional/vimscript/execute_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/functional/vimscript/execute_spec.lua') diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index b9893a5150..bf86f1623e 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -93,13 +93,13 @@ describe('execute()', function() it('captures errors', function() local ret ret = exc_exec('call execute(0.0)') - eq('Vim(call):E806: using Float as a String', ret) + eq('Vim(call):E806: Using Float as a String', ret) ret = exc_exec('call execute(v:_null_dict)') eq('Vim(call):E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(function("tr"))') eq('Vim(call):E729: Using a Funcref as a String', ret) ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])') - eq('Vim:E806: using Float as a String', ret) + eq('Vim:E806: Using Float as a String', ret) ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])') eq('Vim:E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])') @@ -322,7 +322,7 @@ describe('execute()', function() it('propagates errors for "" and "silent"', function() local ret ret = exc_exec('call execute(0.0, "")') - eq('Vim(call):E806: using Float as a String', ret) + eq('Vim(call):E806: Using Float as a String', ret) ret = exc_exec('call execute(v:_null_dict, "silent")') eq('Vim(call):E731: Using a Dictionary as a String', ret) -- cgit From bdaaf2e8e113f8c32c70f83b60e0bf3f648357c1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 May 2023 09:00:35 +0800 Subject: vim-patch:9.0.0250: slightly inconsistent error messages Problem: Slightly inconsistent error messages. Solution: Make it "Using a Float". (closes vim/vim#10959) https://github.com/vim/vim/commit/dde77a7c4d72622284dc5fb72557bde42c314fa6 Co-authored-by: Bram Moolenaar --- test/functional/vimscript/execute_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/functional/vimscript/execute_spec.lua') diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index bf86f1623e..17edf5c93e 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -93,13 +93,13 @@ describe('execute()', function() it('captures errors', function() local ret ret = exc_exec('call execute(0.0)') - eq('Vim(call):E806: Using Float as a String', ret) + eq('Vim(call):E806: Using a Float as a String', ret) ret = exc_exec('call execute(v:_null_dict)') eq('Vim(call):E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(function("tr"))') eq('Vim(call):E729: Using a Funcref as a String', ret) ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])') - eq('Vim:E806: Using Float as a String', ret) + eq('Vim:E806: Using a Float as a String', ret) ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])') eq('Vim:E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])') @@ -322,7 +322,7 @@ describe('execute()', function() it('propagates errors for "" and "silent"', function() local ret ret = exc_exec('call execute(0.0, "")') - eq('Vim(call):E806: Using Float as a String', ret) + eq('Vim(call):E806: Using a Float as a String', ret) ret = exc_exec('call execute(v:_null_dict, "silent")') eq('Vim(call):E731: Using a Dictionary as a String', ret) -- cgit From 3a1e17e3a1767b4ff8a082150f7f9d6bda50cc8f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 May 2023 19:03:08 +0800 Subject: test: add tests for executing commands with backwards range --- test/functional/vimscript/execute_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional/vimscript/execute_spec.lua') diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index 17edf5c93e..a9a4ad4811 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -4,6 +4,7 @@ local eval = helpers.eval local clear = helpers.clear local source = helpers.source local exc_exec = helpers.exc_exec +local pcall_err = helpers.pcall_err local funcs = helpers.funcs local Screen = require('test.functional.ui.screen') local command = helpers.command @@ -284,6 +285,14 @@ describe('execute()', function() eq('42', eval('g:mes')) end) + it('gives E493 instead of prompting on backwards range for ""', function() + command('split') + eq('Vim(windo):E493: Backwards range given: 2,1windo echo', + pcall_err(funcs.execute, '2,1windo echo', '')) + eq('Vim(windo):E493: Backwards range given: 2,1windo echo', + pcall_err(funcs.execute, {'2,1windo echo'}, '')) + end) + it('captures but does not display output for "silent"', function() local screen = Screen.new(40, 5) screen:attach() -- cgit From 7abfb1f86e25efcbe6ec31c8d3f196a60d718123 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 12 Jun 2023 12:48:14 +0800 Subject: vim-patch:8.2.2949: tests failing because no error for float to string conversion Problem: Tests failing because there is no error for float to string conversion. Solution: Change the check for failure to check for correct result. Make some conversions strict in Vim9 script. https://github.com/vim/vim/commit/3cfa5b16b06bcc034f6de77070fa779d698ab5e9 Co-authored-by: Bram Moolenaar --- test/functional/vimscript/execute_spec.lua | 7 ------- 1 file changed, 7 deletions(-) (limited to 'test/functional/vimscript/execute_spec.lua') diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index a9a4ad4811..bb28938708 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -93,14 +93,10 @@ describe('execute()', function() it('captures errors', function() local ret - ret = exc_exec('call execute(0.0)') - eq('Vim(call):E806: Using a Float as a String', ret) ret = exc_exec('call execute(v:_null_dict)') eq('Vim(call):E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(function("tr"))') eq('Vim(call):E729: Using a Funcref as a String', ret) - ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])') - eq('Vim:E806: Using a Float as a String', ret) ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])') eq('Vim:E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])') @@ -330,9 +326,6 @@ describe('execute()', function() it('propagates errors for "" and "silent"', function() local ret - ret = exc_exec('call execute(0.0, "")') - eq('Vim(call):E806: Using a Float as a String', ret) - ret = exc_exec('call execute(v:_null_dict, "silent")') eq('Vim(call):E731: Using a Dictionary as a String', ret) -- cgit