Merge pull request #7545 from jamessan/test-fixes

Fix test failures found in Debian builds, closes #7522
This commit is contained in:
James McCoy
2017-11-12 21:09:44 -05:00
committed by GitHub
5 changed files with 29 additions and 10 deletions

View File

@@ -89,7 +89,8 @@ Dictionary nvim_get_hl_by_id(Integer hl_id, Boolean rgb, Error *err)
{ {
Dictionary dic = ARRAY_DICT_INIT; Dictionary dic = ARRAY_DICT_INIT;
if (syn_get_final_id((int)hl_id) == 0) { if (syn_get_final_id((int)hl_id) == 0) {
api_set_error(err, kErrorTypeException, "Invalid highlight id: %d", hl_id); api_set_error(err, kErrorTypeException,
"Invalid highlight id: %" PRId64, hl_id);
return dic; return dic;
} }
int attrcode = syn_id2attr((int)hl_id); int attrcode = syn_id2attr((int)hl_id);

View File

@@ -8256,7 +8256,7 @@ Dictionary hl_get_attr_by_id(Integer attr_id, Boolean rgb, Error *err)
attrentry_T *aep = syn_cterm_attr2entry((int)attr_id); attrentry_T *aep = syn_cterm_attr2entry((int)attr_id);
if (!aep) { if (!aep) {
api_set_error(err, kErrorTypeException, api_set_error(err, kErrorTypeException,
"Invalid attribute id: %d", attr_id); "Invalid attribute id: %" PRId64, attr_id);
return dic; return dic;
} }

View File

@@ -50,8 +50,8 @@ describe('terminal cursor', function()
it('is positioned correctly when unfocused', function() it('is positioned correctly when unfocused', function()
screen:expect([[ screen:expect([[
{7: 1 }tty ready | {7: 1 }tty ready |
{7: 2 }{2:^ } | {7: 2 }^rows: 6, cols: 46 |
{7: 3 } | {7: 3 }{2: } |
{7: 4 } | {7: 4 } |
{7: 5 } | {7: 5 } |
{7: 6 } | {7: 6 } |
@@ -60,12 +60,21 @@ describe('terminal cursor', function()
end) end)
it('is positioned correctly when focused', function() it('is positioned correctly when focused', function()
screen:expect([[
{7: 1 }tty ready |
{7: 2 }^rows: 6, cols: 46 |
{7: 3 }{2: } |
{7: 4 } |
{7: 5 } |
{7: 6 } |
:set number |
]])
feed('i') feed('i')
helpers.wait() helpers.wait()
screen:expect([[ screen:expect([[
{7: 1 }tty ready | {7: 1 }tty ready |
{7: 2 }{1: } | {7: 2 }rows: 6, cols: 46 |
{7: 3 } | {7: 3 }{1: } |
{7: 4 } | {7: 4 } |
{7: 5 } | {7: 5 } |
{7: 6 } | {7: 6 } |

View File

@@ -380,7 +380,7 @@ describe("tui 't_Co' (terminal colors)", function()
-- TODO: Revisit this after jobstart/termopen accept `env` dict. -- TODO: Revisit this after jobstart/termopen accept `env` dict.
screen = thelpers.screen_setup(0, string.format( screen = thelpers.screen_setup(0, string.format(
[=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "silent set noswapfile noshowcmd noruler"']]=], [=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "silent set noswapfile noshowcmd noruler"']]=],
term, term or "",
(colorterm ~= nil and "COLORTERM="..colorterm or ""), (colorterm ~= nil and "COLORTERM="..colorterm or ""),
helpers.nvim_prog)) helpers.nvim_prog))

View File

@@ -43,14 +43,23 @@ describe('terminal window', function()
-- numberwidth=9 -- numberwidth=9
feed([[<C-\><C-N>]]) feed([[<C-\><C-N>]])
feed([[:set numberwidth=9 number<CR>i]]) feed([[:set numberwidth=9 number<CR>i]])
screen:expect([[
{7: 1 }tty ready |
{7: 2 }rows: 6, cols: 48 |
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
{7: 4 }WXYZrows: 6, cols: 41 |
{7: 5 }{1: } |
{7: 6 } |
{3:-- TERMINAL --} |
]])
thelpers.feed_data({' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'}) thelpers.feed_data({' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'})
screen:expect([[ screen:expect([[
{7: 1 }tty ready | {7: 1 }tty ready |
{7: 2 }rows: 6, cols: 48 | {7: 2 }rows: 6, cols: 48 |
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO| {7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
{7: 4 }WXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJ| {7: 4 }WXYZrows: 6, cols: 41 |
{7: 5 }KLMNOPQRSTUVWXYZrows: 6, cols: 41 | {7: 5 } abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN|
{7: 6 }{1: } | {7: 6 }OPQRSTUVWXYZ{1: } |
{3:-- TERMINAL --} | {3:-- TERMINAL --} |
]]) ]])
end) end)