From 46a87a5d2bac598fed0870f0d3c926087f95d30f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 14 Feb 2023 05:19:04 -0500 Subject: refactor(api): VALIDATE macros #22187 Problem: - API validation involves too much boilerplate. - API validation errors are not consistently worded. Solution: Introduce some macros. Currently these are clumsy, but they at least help with consistency and avoid some nesting. --- test/functional/api/buffer_updates_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/api/buffer_updates_spec.lua') diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index d5f06c8f1f..1510d31945 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -762,7 +762,7 @@ describe('API: buffer events:', function() it('returns a proper error on nonempty options dict', function() clear() local b = editoriginal(false) - eq("unexpected key: builtin", pcall_err(buffer, 'attach', b, false, {builtin="asfd"})) + eq("Invalid key: 'builtin'", pcall_err(buffer, 'attach', b, false, {builtin="asfd"})) end) it('nvim_buf_attach returns response after delay #8634', function() -- cgit From 556f8646c01d1751cf39fe4df9c622899dceab9d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 14 Feb 2023 14:19:28 -0500 Subject: refactor(api): consistent VALIDATE messages #22262 Problem: Validation messages are not consistently formatted. - Parameter names sometimes are NOT quoted. - Descriptive names (non-parameters) sometimes ARE quoted. Solution: Always quote the `name` value passed to a VALIDATE macro _unless_ the value has whitespace. --- test/functional/api/buffer_updates_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/api/buffer_updates_spec.lua') diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index 1510d31945..25b838a4af 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -762,7 +762,7 @@ describe('API: buffer events:', function() it('returns a proper error on nonempty options dict', function() clear() local b = editoriginal(false) - eq("Invalid key: 'builtin'", pcall_err(buffer, 'attach', b, false, {builtin="asfd"})) + eq("Invalid 'opts' key: 'builtin'", pcall_err(buffer, 'attach', b, false, {builtin="asfd"})) end) it('nvim_buf_attach returns response after delay #8634', function() -- cgit From 269dd747b6e61842856031ca14ac26ee884ede4c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 2 Apr 2023 23:01:48 +0800 Subject: refactor(defaults)!: change default 'commentstring' value to empty (#22862) --- test/functional/api/buffer_updates_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/api/buffer_updates_spec.lua') diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index 25b838a4af..80e29c1ff2 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -75,7 +75,7 @@ local function reopenwithfolds(b) local tick = reopen(b, origlines) -- use markers for folds, make all folds open by default - command('setlocal foldmethod=marker foldlevel=20') + command('setlocal foldmethod=marker foldlevel=20 commentstring=/*%s*/') -- add a fold command('2,4fold') -- cgit