From 0e0a166a0cc5a2dc199136e313e58c27bfb91977 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 7 Jun 2023 09:00:55 +0800 Subject: refactor(api): adjust errors for setting options (#23942) --- test/functional/api/vim_spec.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/functional/api/vim_spec.lua') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 040c26e058..98e5482218 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1435,8 +1435,12 @@ describe('API', function() pcall_err(nvim, 'set_option_value', 'scrolloff', 1, {scope = 'bogus'})) eq("Invalid 'scope': expected String, got Integer", pcall_err(nvim, 'get_option_value', 'scrolloff', {scope = 42})) - eq("Invalid 'scrolloff': expected Integer/Boolean/String, got Array", + eq("Invalid 'value': expected Integer/Boolean/String, got Array", pcall_err(nvim, 'set_option_value', 'scrolloff', {}, {})) + eq("Invalid value for option 'scrolloff': expected Number, got Boolean true", + pcall_err(nvim, 'set_option_value', 'scrolloff', true, {})) + eq("Invalid value for option 'scrolloff': expected Number, got String \"wrong\"", + pcall_err(nvim, 'set_option_value', 'scrolloff', 'wrong', {})) end) it('can get local values when global value is set', function() -- cgit