diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-17 09:45:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-17 01:45:53 +0000 |
commit | bfd59c955f86579c60a07c7370497003fb5d7c95 (patch) | |
tree | 09468ada068013821b1439d4e6234aefab77695b | |
parent | 9d699e20054d7224b056f104e7a702ae688e4f8a (diff) | |
download | rneovim-bfd59c955f86579c60a07c7370497003fb5d7c95.tar.gz rneovim-bfd59c955f86579c60a07c7370497003fb5d7c95.tar.bz2 rneovim-bfd59c955f86579c60a07c7370497003fb5d7c95.zip |
test: reduce flakiness in highlight tests (#32488)
-rw-r--r-- | test/functional/legacy/number_spec.lua | 17 | ||||
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 34 |
2 files changed, 18 insertions, 33 deletions
diff --git a/test/functional/legacy/number_spec.lua b/test/functional/legacy/number_spec.lua index 4636cd0369..3212524f9d 100644 --- a/test/functional/legacy/number_spec.lua +++ b/test/functional/legacy/number_spec.lua @@ -221,30 +221,25 @@ describe("'number' and 'relativenumber'", function() func Func(timer) call cursor(1, 1) endfunc - - call timer_start(300, 'Func') ]]) - screen:expect({ - grid = [[ + screen:expect([[ {8: 3 }aaaaa | {8: 2 }bbbbb | {8: 1 }ccccc | {8: 0 }^ddddd | {1:~ }|*3 | - ]], - timeout = 100, - }) - screen:expect({ - grid = [[ + ]]) + command([[call timer_start(300, 'Func')]]) + screen:expect_unchanged(false, 100) + screen:expect([[ {8: 0 }^aaaaa | {8: 1 }bbbbb | {8: 2 }ccccc | {8: 3 }ddddd | {1:~ }|*3 | - ]], - }) + ]]) end) -- oldtest: Test_number_insert_delete_lines() diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 0f4696f3d3..0cd2204c06 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -1159,30 +1159,25 @@ describe('CursorLine and CursorLineNr highlights', function() func Func(timer) call cursor(2, 1) endfunc - - call timer_start(300, 'Func') ]]) - screen:expect({ - grid = [[ + screen:expect([[ aaaaa | bbbbb | ccccc | {21:^ddddd }| {1:~ }|*3 | - ]], - timeout = 100, - }) - screen:expect({ - grid = [[ + ]]) + command([[call timer_start(300, 'Func')]]) + screen:expect_unchanged(false, 100) + screen:expect([[ aaaaa | {21:^bbbbb }| ccccc | ddddd | {1:~ }|*3 | - ]], - }) + ]]) end) it('with split windows in diff mode', function() @@ -1337,30 +1332,25 @@ describe('CursorColumn highlight', function() func Func(timer) call cursor(1, 1) endfunc - - call timer_start(300, 'Func') ]]) - screen:expect({ - grid = [[ + screen:expect([[ aaaa{21:a} | bbbb{21:b} | cccc{21:c} | dddd^d | {1:~ }|*3 | - ]], - timeout = 100, - }) - screen:expect({ - grid = [[ + ]]) + command([[call timer_start(300, 'Func')]]) + screen:expect_unchanged(false, 100) + screen:expect([[ ^aaaaa | {21:b}bbbb | {21:c}cccc | {21:d}dddd | {1:~ }|*3 | - ]], - }) + ]]) end) it('is not shown on current line with virtualedit', function() |