diff options
Diffstat (limited to 'test/functional/options/chars_spec.lua')
-rw-r--r-- | test/functional/options/chars_spec.lua | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua index 64de25112a..e9c20b5da9 100644 --- a/test/functional/options/chars_spec.lua +++ b/test/functional/options/chars_spec.lua @@ -1,9 +1,9 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, command = helpers.clear, helpers.command +local pcall_err = helpers.pcall_err local eval = helpers.eval local eq = helpers.eq -local exc_exec = helpers.exc_exec local insert = helpers.insert local feed = helpers.feed local api = helpers.api @@ -17,11 +17,6 @@ describe("'fillchars'", function() screen:attach() end) - local function shouldfail(val, errval) - errval = errval or val - eq('Vim(set):E474: Invalid argument: fillchars=' .. errval, exc_exec('set fillchars=' .. val)) - end - describe('"eob" flag', function() it("uses '~' by default", function() eq('', eval('&fillchars')) @@ -64,10 +59,22 @@ describe("'fillchars'", function() end) it('handles invalid values', function() - shouldfail('eob:') -- empty string - shouldfail('eob:馬') -- doublewidth char - shouldfail('eob:xy') -- two ascii chars - shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8 + eq( + 'Vim(set):E1511: Wrong number of characters for field "eob": fillchars=eob:', + pcall_err(command, 'set fillchars=eob:') -- empty string + ) + eq( + 'Vim(set):E1512: Wrong character width for field "eob": fillchars=eob:馬', + pcall_err(command, 'set fillchars=eob:馬') -- doublewidth char + ) + eq( + 'Vim(set):E1511: Wrong number of characters for field "eob": fillchars=eob:xy', + pcall_err(command, 'set fillchars=eob:xy') -- two ascii chars + ) + eq( + 'Vim(set):E1512: Wrong character width for field "eob": fillchars=eob:<ff>', + pcall_err(command, 'set fillchars=eob:\255') -- invalid UTF-8 + ) end) end) |