diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-06 18:16:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-06 18:16:57 -0700 |
commit | 158b78062e9daa65203b4591dae733dd6c11ad2c (patch) | |
tree | e6988da22f16062b57d50daeda084bcc489a6a1d /test/functional/ui/float_spec.lua | |
parent | 638f2b6dee7439de303bea12dec80240617e8034 (diff) | |
parent | 7e1c9598617a140e40a0a22676c0631294617246 (diff) | |
download | rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.tar.gz rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.tar.bz2 rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.zip |
Merge #10932 'test: Eliminate expect_err'
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index c8cf9d830e..f6c18ba841 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -10,7 +10,7 @@ local meths = helpers.meths local curbufmeths = helpers.curbufmeths local funcs = helpers.funcs local run = helpers.run -local meth_pcall = helpers.meth_pcall +local pcall_err = helpers.pcall_err describe('floating windows', function() before_each(function() @@ -636,26 +636,26 @@ describe('floating windows', function() it('API has proper error messages', function() local buf = meths.create_buf(false,false) - eq({false, "Invalid key 'bork'"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=2,bork=true})) - eq({false, "'win' key is only valid with relative='win'"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) - eq({false, "Only one of 'relative' and 'external' must be used"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) - eq({false, "Invalid value of 'relative' key"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) - eq({false, "Invalid value of 'anchor' key"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) - eq({false, "All of 'relative', 'row', and 'col' has to be specified at once"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='editor'})) - eq({false, "'width' key must be a positive Integer"}, - meth_pcall(meths.open_win,buf, false, {width=-1,height=2,relative='editor'})) - eq({false, "'height' key must be a positive Integer"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=-1,relative='editor'})) - eq({false, "'height' key must be a positive Integer"}, - meth_pcall(meths.open_win,buf, false, {width=20,height=0,relative='editor'})) - eq({false, "Must specify 'width' and 'height'"}, - meth_pcall(meths.open_win,buf, false, {relative='editor'})) + eq("Invalid key 'bork'", + pcall_err(meths.open_win,buf, false, {width=20,height=2,bork=true})) + eq("'win' key is only valid with relative='win'", + pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) + eq("Only one of 'relative' and 'external' must be used", + pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) + eq("Invalid value of 'relative' key", + pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) + eq("Invalid value of 'anchor' key", + pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) + eq("All of 'relative', 'row', and 'col' has to be specified at once", + pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor'})) + eq("'width' key must be a positive Integer", + pcall_err(meths.open_win,buf, false, {width=-1,height=2,relative='editor'})) + eq("'height' key must be a positive Integer", + pcall_err(meths.open_win,buf, false, {width=20,height=-1,relative='editor'})) + eq("'height' key must be a positive Integer", + pcall_err(meths.open_win,buf, false, {width=20,height=0,relative='editor'})) + eq("Must specify 'width' and 'height'", + pcall_err(meths.open_win,buf, false, {relative='editor'})) end) it('can be placed relative window or cursor', function() @@ -4528,8 +4528,8 @@ describe('floating windows', function() {0:~ }| ]], float_pos=expected_pos} else - eq({false, "UI doesn't support external windows"}, - meth_pcall(meths.win_set_config, 0, {external=true, width=30, height=2})) + eq("UI doesn't support external windows", + pcall_err(meths.win_set_config, 0, {external=true, width=30, height=2})) return end @@ -4844,8 +4844,8 @@ describe('floating windows', function() {0:~ }| ]], float_pos=expected_pos} else - eq({false, "UI doesn't support external windows"}, - meth_pcall(meths.win_set_config, 0, {external=true, width=65, height=4})) + eq("UI doesn't support external windows", + pcall_err(meths.win_set_config, 0, {external=true, width=65, height=4})) end feed(":tabnext<cr>") |