Skip to content

Commit

Permalink
patch 8.2.0884: searchcount() test fails on slower systems
Browse files Browse the repository at this point in the history
Problem:    Searchcount() test fails on slower systems.
Solution:   Set a longer timeout.
  • Loading branch information
brammool committed Jun 1, 2020
1 parent 5fbf3bc commit ea6561a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/search.c
Expand Up @@ -36,7 +36,7 @@ typedef struct searchstat
static void cmdline_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, int show_top_bot_msg, char_u *msgbuf, int recompute, int maxcount, long timeout);
static void update_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, searchstat_T *stat, int recompute, int maxcount, long timeout);

#define SEARCH_STAT_DEF_TIMEOUT 20L
#define SEARCH_STAT_DEF_TIMEOUT 40L
#define SEARCH_STAT_DEF_MAX_COUNT 99
#define SEARCH_STAT_BUF_LEN 12

Expand Down
8 changes: 4 additions & 4 deletions src/testdir/test_search_stat.vim
Expand Up @@ -87,10 +87,10 @@ func Test_search_stat()
\ searchcount(#{recompute: 0}))
call assert_equal(
\ #{current: 272, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
\ searchcount(#{recompute: v:true, maxcount: 0}))
\ searchcount(#{recompute: v:true, maxcount: 0, timeout: 200}))
call assert_equal(
\ #{current: 1, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0]}))
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 200}))
call cursor(line('$'), 1)
let g:a = execute(':unsilent :norm! n')
let stat = 'W \[1/>99\]'
Expand All @@ -100,10 +100,10 @@ func Test_search_stat()
\ searchcount(#{recompute: 0}))
call assert_equal(
\ #{current: 1, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
\ searchcount(#{recompute: 1, maxcount: 0}))
\ searchcount(#{recompute: 1, maxcount: 0, timeout: 200}))
call assert_equal(
\ #{current: 271, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0]}))
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 200}))

" Many matches
call cursor(1, 1)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -746,6 +746,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
884,
/**/
883,
/**/
Expand Down

0 comments on commit ea6561a

Please sign in to comment.