refactor(tutor): cleanup

This commit is contained in:
Justin M. Keyes 2023-09-26 06:41:53 -07:00
parent bc6fc0123d
commit de93489789
2 changed files with 72 additions and 71 deletions

View File

@ -6,13 +6,25 @@ local feed = helpers.feed
local is_os = helpers.is_os
describe(':Tutor', function()
local screen
before_each(function()
clear({ args = { '-u', 'NORC' } })
clear({ args = { '--clean' } })
command('set cmdheight=0')
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)
it('should apply transformation', function()
it('applies {unix:…,win:…} transform', function()
local expected = is_os('win') and [[
{0: }^ |
{0: } 3. To verify that a file was retrieved, cursor back and notice that there |
@ -77,18 +89,7 @@ describe(':Tutor', function()
{0: } |
]]
local 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()
feed(':700<CR>z<CR>')
feed(':700<CR>zt')
screen:expect(expected)
end)
end)