feat(lua): improve error message to make it actionable (#13276)

* improve error message to make it actionable
This commit is contained in:
Alvaro Muñoz
2020-11-13 19:50:03 +01:00
committed by GitHub
parent 35325ddac0
commit aaca2c1c4d
5 changed files with 9 additions and 9 deletions

View File

@@ -57,7 +57,7 @@ describe('API: highlight',function()
-- Test nil argument.
err, emsg = pcall(meths.get_hl_by_id, { nil }, false)
eq(false, err)
eq('Wrong type for argument 1, expecting Integer',
eq('Wrong type for argument 1 when calling nvim_get_hl_by_id, expecting Integer',
string.match(emsg, 'Wrong.*'))
-- Test 0 argument.
@@ -112,7 +112,7 @@ describe('API: highlight',function()
-- Test nil argument.
err, emsg = pcall(meths.get_hl_by_name , { nil }, false)
eq(false, err)
eq('Wrong type for argument 1, expecting String',
eq('Wrong type for argument 1 when calling nvim_get_hl_by_name, expecting String',
string.match(emsg, 'Wrong.*'))
-- Test empty string argument.