mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
shell: add test for binary and multibyte output
Also update existing tests for new (vim-compatible) newline behavior
This commit is contained in:
parent
2d99b81ab5
commit
9af14506e5
@ -3,13 +3,14 @@
|
|||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local feed, command, clear = helpers.feed, helpers.command, helpers.clear
|
local feed, command, clear = helpers.feed, helpers.command, helpers.clear
|
||||||
local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
|
local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
|
||||||
|
local feed_command = helpers.feed_command
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
|
|
||||||
|
|
||||||
describe('issues', function()
|
describe(':! command', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@ -19,7 +20,12 @@ describe('issues', function()
|
|||||||
write_file('bang_filter_spec/f1', 'f1')
|
write_file('bang_filter_spec/f1', 'f1')
|
||||||
write_file('bang_filter_spec/f2', 'f2')
|
write_file('bang_filter_spec/f2', 'f2')
|
||||||
write_file('bang_filter_spec/f3', 'f3')
|
write_file('bang_filter_spec/f3', 'f3')
|
||||||
screen = Screen.new()
|
screen = Screen.new(53,10)
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[1] = {bold = true, foreground = Screen.colors.Blue1},
|
||||||
|
[2] = {foreground = Screen.colors.Blue1},
|
||||||
|
[3] = {bold = true, foreground = Screen.colors.SeaGreen4},
|
||||||
|
})
|
||||||
screen:attach()
|
screen:attach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -27,25 +33,37 @@ describe('issues', function()
|
|||||||
rmdir('bang_filter_spec')
|
rmdir('bang_filter_spec')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('#3269 Last line of shell output is not truncated', function()
|
it("doesn't truncate Last line of shell output #3269", function()
|
||||||
command([[nnoremap <silent>\l :!ls bang_filter_spec<cr>]])
|
command([[nnoremap <silent>\l :!ls bang_filter_spec<cr>]])
|
||||||
feed([[\l]])
|
feed([[\l]])
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
~ |
|
{1:~ }|
|
||||||
~ |
|
{1:~ }|
|
||||||
~ |
|
{1:~ }|
|
||||||
~ |
|
{1:~ }|
|
||||||
~ |
|
|
||||||
~ |
|
|
||||||
~ |
|
|
||||||
~ |
|
|
||||||
:!ls bang_filter_spec |
|
:!ls bang_filter_spec |
|
||||||
|
|
|
||||||
f1 |
|
f1 |
|
||||||
f2 |
|
f2 |
|
||||||
f3 |
|
f3 |
|
||||||
Press ENTER or type command to continue^ |
|
|
|
||||||
|
{3:Press ENTER or type command to continue}^ |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('handles binary and multibyte data', function()
|
||||||
|
feed_command('!cat test/functional/fixtures/shell_data.txt')
|
||||||
|
screen:expect([[
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
:!cat test/functional/fixtures/shell_data.txt |
|
||||||
|
{2:^@^A^B^C^D^E^F^G^H} |
|
||||||
|
{2:^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_} |
|
||||||
|
ö 한글 {2:<a5><c3>} |
|
||||||
|
t {2:<ff>} |
|
||||||
|
|
|
||||||
|
{3:Press ENTER or type command to continue}^ |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
BIN
test/functional/fixtures/shell_data.txt
Normal file
BIN
test/functional/fixtures/shell_data.txt
Normal file
Binary file not shown.
@ -33,8 +33,8 @@ describe("shell command :!", function()
|
|||||||
{4:~ }|
|
{4:~ }|
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
|
{4:~ }|
|
||||||
:!printf foo; sleep 200 |
|
:!printf foo; sleep 200 |
|
||||||
|
|
|
||||||
foo |
|
foo |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
@ -56,11 +56,11 @@ describe("shell command :!", function()
|
|||||||
-- Final chunk of output should always be displayed, never skipped.
|
-- Final chunk of output should always be displayed, never skipped.
|
||||||
-- (Throttling is non-deterministic, this test is merely a sanity check.)
|
-- (Throttling is non-deterministic, this test is merely a sanity check.)
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
XXXXXXXXXX 2996 |
|
|
||||||
XXXXXXXXXX 2997 |
|
XXXXXXXXXX 2997 |
|
||||||
XXXXXXXXXX 2998 |
|
XXXXXXXXXX 2998 |
|
||||||
XXXXXXXXXX 2999 |
|
XXXXXXXXXX 2999 |
|
||||||
XXXXXXXXXX 3000 |
|
XXXXXXXXXX 3000 |
|
||||||
|
|
|
||||||
{10:Press ENTER or type command to continue}{1: } |
|
{10:Press ENTER or type command to continue}{1: } |
|
||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
|
Loading…
Reference in New Issue
Block a user