mirror of
https://github.com/neovim/neovim.git
synced 2025-11-07 03:04:22 +00:00
refactor(tutor): cleanup
This commit is contained in:
@@ -6,13 +6,25 @@ local feed = helpers.feed
|
|||||||
local is_os = helpers.is_os
|
local is_os = helpers.is_os
|
||||||
|
|
||||||
describe(':Tutor', function()
|
describe(':Tutor', function()
|
||||||
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear({ args = { '-u', 'NORC' } })
|
clear({ args = { '--clean' } })
|
||||||
command('set cmdheight=0')
|
command('set cmdheight=0')
|
||||||
command('Tutor')
|
command('Tutor')
|
||||||
|
screen = Screen.new(80, 30)
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[0] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray },
|
||||||
|
[1] = { bold = true },
|
||||||
|
[2] = { underline = true, foreground = tonumber('0x0088ff') },
|
||||||
|
[3] = { foreground = Screen.colors.SlateBlue },
|
||||||
|
[4] = { bold = true, foreground = Screen.colors.Brown },
|
||||||
|
[5] = { bold = true, foreground = Screen.colors.Magenta1 },
|
||||||
|
})
|
||||||
|
screen:attach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('should apply transformation', function()
|
it('applies {unix:…,win:…} transform', function()
|
||||||
local expected = is_os('win') and [[
|
local expected = is_os('win') and [[
|
||||||
{0: }^ |
|
{0: }^ |
|
||||||
{0: } 3. To verify that a file was retrieved, cursor back and notice that there |
|
{0: } 3. To verify that a file was retrieved, cursor back and notice that there |
|
||||||
@@ -77,18 +89,7 @@ describe(':Tutor', function()
|
|||||||
{0: } |
|
{0: } |
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local screen = Screen.new(80, 30)
|
feed(':700<CR>zt')
|
||||||
screen:set_default_attr_ids({
|
|
||||||
[0] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray },
|
|
||||||
[1] = { bold = true },
|
|
||||||
[2] = { underline = true, foreground = tonumber('0x0088ff') },
|
|
||||||
[3] = { foreground = Screen.colors.SlateBlue },
|
|
||||||
[4] = { bold = true, foreground = Screen.colors.Brown },
|
|
||||||
[5] = { bold = true, foreground = Screen.colors.Magenta1 },
|
|
||||||
})
|
|
||||||
screen:attach()
|
|
||||||
|
|
||||||
feed(':700<CR>z<CR>')
|
|
||||||
screen:expect(expected)
|
screen:expect(expected)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user