diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-19 15:42:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 15:42:55 +0800 |
commit | d7448767232f5793248f7c64fdb77921666dc991 (patch) | |
tree | ea2722b2af76e58c07f4790afff527af937dfe14 /test/functional/terminal/cursor_spec.lua | |
parent | 400ef8aaa0766544fb0bcb4d367fa2da5279c5f3 (diff) | |
download | rneovim-d7448767232f5793248f7c64fdb77921666dc991.tar.gz rneovim-d7448767232f5793248f7c64fdb77921666dc991.tar.bz2 rneovim-d7448767232f5793248f7c64fdb77921666dc991.zip |
test(terminal/cursor_spec): unskip tests that pass on Windows (#27924)
Also:
- Make indent of test cases consistent.
- Unskip TUI rapid resize test with ASAN as reflow is now disabled.
Diffstat (limited to 'test/functional/terminal/cursor_spec.lua')
-rw-r--r-- | test/functional/terminal/cursor_spec.lua | 154 |
1 files changed, 68 insertions, 86 deletions
diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua index 73fd97203e..9a56b4600b 100644 --- a/test/functional/terminal/cursor_spec.lua +++ b/test/functional/terminal/cursor_spec.lua @@ -189,7 +189,7 @@ describe('buffer cursor position is correct in terminal without number column', before_each(clear) - describe('in a line with no multibyte characters or trailing spaces,', function() + describe('in a line with no multibyte chars or trailing spaces,', function() before_each(function() setup_ex_register('aaaaaaaa') end) @@ -252,7 +252,7 @@ describe('buffer cursor position is correct in terminal without number column', end) end) - describe('in a line with single-cell multibyte characters and no trailing spaces,', function() + describe('in a line with single-cell multibyte chars and no trailing spaces,', function() before_each(function() setup_ex_register('µµµµµµµµ') end) @@ -315,81 +315,72 @@ describe('buffer cursor position is correct in terminal without number column', end) end) - describe( - 'in a line with single-cell composed multibyte characters and no trailing spaces,', - function() - if skip(is_os('win'), 'Encoding problem?') then - return - end - - before_each(function() - setup_ex_register('µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳') - end) + describe('in a line with single-cell composed multibyte chars and no trailing spaces,', function() + before_each(function() + setup_ex_register('µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳') + end) - it('at the end', function() - feed('<C-R>r') - screen:expect([[ + it('at the end', function() + feed('<C-R>r') + screen:expect([[ |*4 Entering Ex mode. Type "visual" to go to Normal mode. | :µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{2:^ } | {3:-- TERMINAL --} | ]]) - eq({ 6, 33 }, eval('nvim_win_get_cursor(0)')) - feed([[<C-\><C-N>]]) - screen:expect([[ + eq({ 6, 33 }, eval('nvim_win_get_cursor(0)')) + feed([[<C-\><C-N>]]) + screen:expect([[ |*4 Entering Ex mode. Type "visual" to go to Normal mode. | :µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{4: } | | ]]) - eq({ 6, 29 }, eval('nvim_win_get_cursor(0)')) - end) + eq({ 6, 29 }, eval('nvim_win_get_cursor(0)')) + end) - it('near the end', function() - feed('<C-R>r<C-X><C-X>') - screen:expect([[ + it('near the end', function() + skip(is_os('win')) + feed('<C-R>r<C-X><C-X>') + screen:expect([[ |*4 Entering Ex mode. Type "visual" to go to Normal mode. | :µ̳µ̳µ̳µ̳µ̳µ̳{2:^µ̳}µ̳ | {3:-- TERMINAL --} | ]]) - eq({ 6, 25 }, eval('nvim_win_get_cursor(0)')) - feed([[<C-\><C-N>]]) - screen:expect([[ + eq({ 6, 25 }, eval('nvim_win_get_cursor(0)')) + feed([[<C-\><C-N>]]) + screen:expect([[ |*4 Entering Ex mode. Type "visual" to go to Normal mode. | :µ̳µ̳µ̳µ̳µ̳^µ̳{4:µ̳}µ̳ | | ]]) - eq({ 6, 21 }, eval('nvim_win_get_cursor(0)')) - end) + eq({ 6, 21 }, eval('nvim_win_get_cursor(0)')) + end) - it('near the start', function() - feed('<C-R>r<C-B><C-O>') - screen:expect([[ + it('near the start', function() + skip(is_os('win')) + feed('<C-R>r<C-B><C-O>') + screen:expect([[ |*4 Entering Ex mode. Type "visual" to go to Normal mode. | :µ̳{2:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | {3:-- TERMINAL --} | ]]) - eq({ 6, 5 }, eval('nvim_win_get_cursor(0)')) - feed([[<C-\><C-N>]]) - screen:expect([[ + eq({ 6, 5 }, eval('nvim_win_get_cursor(0)')) + feed([[<C-\><C-N>]]) + screen:expect([[ |*4 Entering Ex mode. Type "visual" to go to Normal mode. | :^µ̳{4:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | | ]]) - eq({ 6, 1 }, eval('nvim_win_get_cursor(0)')) - end) - end - ) - - describe('in a line with double-cell multibyte characters and no trailing spaces,', function() - if skip(is_os('win'), 'Encoding problem?') then - return - end + eq({ 6, 1 }, eval('nvim_win_get_cursor(0)')) + end) + end) + describe('in a line with double-cell multibyte chars and no trailing spaces,', function() before_each(function() setup_ex_register('哦哦哦哦哦哦哦哦') end) @@ -522,7 +513,7 @@ describe('buffer cursor position is correct in terminal with number column', fun command('set number') end) - describe('in a line with no multibyte characters or trailing spaces,', function() + describe('in a line with no multibyte chars or trailing spaces,', function() before_each(function() setup_ex_register('aaaaaaaa') end) @@ -603,7 +594,7 @@ describe('buffer cursor position is correct in terminal with number column', fun end) end) - describe('in a line with single-cell multibyte characters and no trailing spaces,', function() + describe('in a line with single-cell multibyte chars and no trailing spaces,', function() before_each(function() setup_ex_register('µµµµµµµµ') end) @@ -684,20 +675,14 @@ describe('buffer cursor position is correct in terminal with number column', fun end) end) - describe( - 'in a line with single-cell composed multibyte characters and no trailing spaces,', - function() - if skip(is_os('win'), 'Encoding problem?') then - return - end - - before_each(function() - setup_ex_register('µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳') - end) + describe('in a line with single-cell composed multibyte chars and no trailing spaces,', function() + before_each(function() + setup_ex_register('µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳') + end) - it('at the end', function() - feed('<C-R>r') - screen:expect([[ + it('at the end', function() + feed('<C-R>r') + screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | @@ -706,9 +691,9 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{2:^ } | {3:-- TERMINAL --} | ]]) - eq({ 6, 33 }, eval('nvim_win_get_cursor(0)')) - feed([[<C-\><C-N>]]) - screen:expect([[ + eq({ 6, 33 }, eval('nvim_win_get_cursor(0)')) + feed([[<C-\><C-N>]]) + screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | @@ -717,12 +702,13 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{4: } | | ]]) - eq({ 6, 29 }, eval('nvim_win_get_cursor(0)')) - end) + eq({ 6, 29 }, eval('nvim_win_get_cursor(0)')) + end) - it('near the end', function() - feed('<C-R>r<C-X><C-X>') - screen:expect([[ + it('near the end', function() + skip(is_os('win')) + feed('<C-R>r<C-X><C-X>') + screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | @@ -731,9 +717,9 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳{2:^µ̳}µ̳ | {3:-- TERMINAL --} | ]]) - eq({ 6, 25 }, eval('nvim_win_get_cursor(0)')) - feed([[<C-\><C-N>]]) - screen:expect([[ + eq({ 6, 25 }, eval('nvim_win_get_cursor(0)')) + feed([[<C-\><C-N>]]) + screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | @@ -742,12 +728,13 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 6 }:µ̳µ̳µ̳µ̳µ̳^µ̳{4:µ̳}µ̳ | | ]]) - eq({ 6, 21 }, eval('nvim_win_get_cursor(0)')) - end) + eq({ 6, 21 }, eval('nvim_win_get_cursor(0)')) + end) - it('near the start', function() - feed('<C-R>r<C-B><C-O>') - screen:expect([[ + it('near the start', function() + skip(is_os('win')) + feed('<C-R>r<C-B><C-O>') + screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | @@ -756,9 +743,9 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 6 }:µ̳{2:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | {3:-- TERMINAL --} | ]]) - eq({ 6, 5 }, eval('nvim_win_get_cursor(0)')) - feed([[<C-\><C-N>]]) - screen:expect([[ + eq({ 6, 5 }, eval('nvim_win_get_cursor(0)')) + feed([[<C-\><C-N>]]) + screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | @@ -767,16 +754,11 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 6 }:^µ̳{4:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | | ]]) - eq({ 6, 1 }, eval('nvim_win_get_cursor(0)')) - end) - end - ) - - describe('in a line with double-cell multibyte characters and no trailing spaces,', function() - if skip(is_os('win'), 'Encoding problem?') then - return - end + eq({ 6, 1 }, eval('nvim_win_get_cursor(0)')) + end) + end) + describe('in a line with double-cell multibyte chars and no trailing spaces,', function() before_each(function() setup_ex_register('哦哦哦哦哦哦哦哦') end) |