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.
This commit is contained in:
Justin M. Keyes
2023-02-14 14:19:28 -05:00
committed by GitHub
parent e03ecb7d31
commit 556f8646c0
18 changed files with 215 additions and 139 deletions

View File

@@ -240,7 +240,7 @@ describe("API: set highlight", function()
it('validation', function()
eq("Invalid 'blend': out of range",
pcall_err(meths.set_hl, 0, 'Test_hl3', {fg='#FF00FF', blend=999}))
eq("Invalid blend: expected Integer, got Array",
eq("Invalid 'blend': expected Integer, got Array",
pcall_err(meths.set_hl, 0, 'Test_hl3', {fg='#FF00FF', blend={}}))
end)