mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
tests: integrate ex_cmds/bang_filter_spec into ui/output_spec
they test the same thing. Filtering is tested elsewhere.
This commit is contained in:
@@ -1,73 +0,0 @@
|
|||||||
-- Specs for bang/filter commands
|
|
||||||
|
|
||||||
local helpers = require('test.functional.helpers')(after_each)
|
|
||||||
local feed, command, clear = helpers.feed, helpers.command, helpers.clear
|
|
||||||
local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
|
|
||||||
local feed_command = helpers.feed_command
|
|
||||||
local eq = helpers.eq
|
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local Screen = require('test.functional.ui.screen')
|
|
||||||
|
|
||||||
|
|
||||||
describe(':! command', function()
|
|
||||||
local screen
|
|
||||||
|
|
||||||
before_each(function()
|
|
||||||
clear()
|
|
||||||
rmdir('bang_filter_spec')
|
|
||||||
mkdir('bang_filter_spec')
|
|
||||||
write_file('bang_filter_spec/f1', 'f1')
|
|
||||||
write_file('bang_filter_spec/f2', 'f2')
|
|
||||||
write_file('bang_filter_spec/f3', 'f3')
|
|
||||||
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()
|
|
||||||
end)
|
|
||||||
|
|
||||||
after_each(function()
|
|
||||||
rmdir('bang_filter_spec')
|
|
||||||
end)
|
|
||||||
|
|
||||||
it("doesn't truncate Last line of shell output #3269", function()
|
|
||||||
command([[nnoremap <silent>\l :!ls bang_filter_spec<cr>]])
|
|
||||||
feed([[\l]])
|
|
||||||
screen:expect([[
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
:!ls bang_filter_spec |
|
|
||||||
f1 |
|
|
||||||
f2 |
|
|
||||||
f3 |
|
|
||||||
|
|
|
||||||
{3:Press ENTER or type command to continue}^ |
|
|
||||||
]])
|
|
||||||
end)
|
|
||||||
|
|
||||||
it('handles binary and multibyte data', function()
|
|
||||||
feed_command('!cat test/functional/fixtures/shell_data.txt')
|
|
||||||
screen.bell = false
|
|
||||||
screen:expect([[
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
:!cat test/functional/fixtures/shell_data.txt |
|
|
||||||
{2:^@^A^B^C^D^E^F^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}^ |
|
|
||||||
]], nil, nil, function()
|
|
||||||
eq(true, screen.bell)
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
|
|
||||||
end)
|
|
@@ -1,19 +1,23 @@
|
|||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local session = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local child_session = require('test.functional.terminal.helpers')
|
local child_session = require('test.functional.terminal.helpers')
|
||||||
local eq = session.eq
|
local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
|
||||||
local eval = session.eval
|
local eq = helpers.eq
|
||||||
local feed = session.feed
|
local eval = helpers.eval
|
||||||
local iswin = session.iswin
|
local feed = helpers.feed
|
||||||
|
local feed_command = helpers.feed_command
|
||||||
|
local iswin = helpers.iswin
|
||||||
|
local clear = helpers.clear
|
||||||
|
local command = helpers.command
|
||||||
|
|
||||||
describe("shell command :!", function()
|
describe("shell command :!", function()
|
||||||
if session.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
local screen
|
local screen
|
||||||
before_each(function()
|
before_each(function()
|
||||||
session.clear()
|
clear()
|
||||||
screen = child_session.screen_setup(0, '["'..session.nvim_prog..
|
screen = child_session.screen_setup(0, '["'..helpers.nvim_prog..
|
||||||
'", "-u", "NONE", "-i", "NONE", "--cmd", "'..session.nvim_set..'"]')
|
'", "-u", "NONE", "-i", "NONE", "--cmd", "'..helpers.nvim_set..'"]')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
{1: } |
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
@@ -46,7 +50,7 @@ describe("shell command :!", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it("throttles shell-command output greater than ~10KB", function()
|
it("throttles shell-command output greater than ~10KB", function()
|
||||||
if os.getenv("TRAVIS") and session.os_name() == "osx" then
|
if os.getenv("TRAVIS") and helpers.os_name() == "osx" then
|
||||||
pending("[Unreliable on Travis macOS.]", function() end)
|
pending("[Unreliable on Travis macOS.]", function() end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -74,7 +78,7 @@ end)
|
|||||||
|
|
||||||
describe("shell command :!", function()
|
describe("shell command :!", function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
session.clear()
|
clear()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("cat a binary file #4142", function()
|
it("cat a binary file #4142", function()
|
||||||
@@ -134,4 +138,62 @@ describe("shell command :!", function()
|
|||||||
]])
|
]])
|
||||||
feed([[<CR>]])
|
feed([[<CR>]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe('', function()
|
||||||
|
local screen
|
||||||
|
before_each(function()
|
||||||
|
rmdir('bang_filter_spec')
|
||||||
|
mkdir('bang_filter_spec')
|
||||||
|
write_file('bang_filter_spec/f1', 'f1')
|
||||||
|
write_file('bang_filter_spec/f2', 'f2')
|
||||||
|
write_file('bang_filter_spec/f3', 'f3')
|
||||||
|
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()
|
||||||
|
end)
|
||||||
|
|
||||||
|
after_each(function()
|
||||||
|
rmdir('bang_filter_spec')
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("doesn't truncate Last line of shell output #3269", function()
|
||||||
|
command([[nnoremap <silent>\l :!ls bang_filter_spec<cr>]])
|
||||||
|
feed([[\l]])
|
||||||
|
screen:expect([[
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
:!ls bang_filter_spec |
|
||||||
|
f1 |
|
||||||
|
f2 |
|
||||||
|
f3 |
|
||||||
|
|
|
||||||
|
{3:Press ENTER or type command to continue}^ |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('handles binary and multibyte data', function()
|
||||||
|
feed_command('!cat test/functional/fixtures/shell_data.txt')
|
||||||
|
screen.bell = false
|
||||||
|
screen:expect([[
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
:!cat test/functional/fixtures/shell_data.txt |
|
||||||
|
{2:^@^A^B^C^D^E^F^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}^ |
|
||||||
|
]], nil, nil, function()
|
||||||
|
eq(true, screen.bell)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user