diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
commit | d5f194ce780c95821a855aca3c19426576d28ae0 (patch) | |
tree | d45f461b19f9118ad2bb1f440a7a08973ad18832 /test/functional/ui/cursor_spec.lua | |
parent | c5d770d311841ea5230426cc4c868e8db27300a8 (diff) | |
parent | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff) | |
download | rneovim-d5f194ce780c95821a855aca3c19426576d28ae0.tar.gz rneovim-d5f194ce780c95821a855aca3c19426576d28ae0.tar.bz2 rneovim-d5f194ce780c95821a855aca3c19426576d28ae0.zip |
Diffstat (limited to 'test/functional/ui/cursor_spec.lua')
-rw-r--r-- | test/functional/ui/cursor_spec.lua | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index d7c0657820..825a90fbc8 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -190,6 +190,19 @@ describe('ui/cursor', function() attr_lm = {}, short_name = 'sm', }, + [18] = { + blinkoff = 500, + blinkon = 500, + blinkwait = 0, + cell_percentage = 0, + cursor_shape = 'block', + name = 'terminal', + hl_id = 3, + id_lm = 3, + attr = { reverse = true }, + attr_lm = { reverse = true }, + short_name = 't', + }, } screen:expect(function() @@ -245,17 +258,20 @@ describe('ui/cursor', function() end end if m.hl_id then - m.hl_id = 66 + m.hl_id = 65 m.attr = { background = Screen.colors.DarkGray } end if m.id_lm then - m.id_lm = 73 + m.id_lm = 72 + m.attr_lm = {} end end -- Assert the new expectation. screen:expect(function() - eq(expected_mode_info, screen._mode_info) + for i, v in ipairs(expected_mode_info) do + eq(v, screen._mode_info[i]) + end eq(true, screen._cursor_style_enabled) eq('normal', screen.mode) end) @@ -361,4 +377,38 @@ describe('ui/cursor', function() end end) end) + + it(':sleep does not hide cursor when sleeping', function() + n.feed(':sleep 100m | echo 42\n') + screen:expect({ + grid = [[ + ^ | + {1:~ }|*3 + :sleep 100m | echo 42 | + ]], + timeout = 100, + }) + screen:expect([[ + ^ | + {1:~ }|*3 + 42 | + ]]) + end) + + it(':sleep! hides cursor when sleeping', function() + n.feed(':sleep! 100m | echo 42\n') + screen:expect({ + grid = [[ + | + {1:~ }|*3 + :sleep! 100m | echo 42 | + ]], + timeout = 100, + }) + screen:expect([[ + ^ | + {1:~ }|*3 + 42 | + ]]) + end) end) |