mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: example_spec.lua
This commit is contained in:
parent
a077f53914
commit
5beb3b8ee5
36
test/functional/example_spec.lua
Normal file
36
test/functional/example_spec.lua
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
-- To run this test:
|
||||||
|
-- TEST_FILE=test/functional/example_spec.lua make functionaltest
|
||||||
|
|
||||||
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
|
local Screen = require('test.functional.ui.screen')
|
||||||
|
local clear, feed = helpers.clear, helpers.feed
|
||||||
|
|
||||||
|
describe('example', function()
|
||||||
|
local screen
|
||||||
|
before_each(function()
|
||||||
|
clear()
|
||||||
|
screen = Screen.new(20,5)
|
||||||
|
screen:attach()
|
||||||
|
screen:set_default_attr_ids( {
|
||||||
|
[0] = {bold=true, foreground=Screen.colors.Blue},
|
||||||
|
[1] = {bold=true, foreground=Screen.colors.Brown}
|
||||||
|
} )
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("works with buffer switch and 'hidden'", function()
|
||||||
|
-- Do some stuff.
|
||||||
|
feed('iline1<cr>line2<esc>')
|
||||||
|
|
||||||
|
-- For debugging only: prints the current screen.
|
||||||
|
-- screen:snapshot_util()
|
||||||
|
|
||||||
|
-- Assert the expected state.
|
||||||
|
screen:expect([[
|
||||||
|
line1 |
|
||||||
|
line^2 |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
end)
|
Loading…
Reference in New Issue
Block a user