Skip to content

Commit 0fdddee

Browse files
committed
patch 8.1.1956: screenshot tests may use a different encoding
Problem: Screenshot tests may use a different encoding. (Dominique Pelle) Solution: Always set 'encoding' to "utf-8" when running Vim in a terminal. (closes #4884)
1 parent 1bc353b commit 0fdddee

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/testdir/dumps/Test_popupwin_behind.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
|~+0#4040ff13&| @34|l+0#0000001#ffd7ff255|i|n|e|4| +0#4040ff13#ffffff0@33
88
|~| @73
99
|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
10-
|A+0&&|l|r|e|a|d|y| |o|n|l|y| |o|n|e| |w|i|n|d|o|w| @51
10+
| +0&&@74

src/testdir/shared.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ func GetVimCommandClean()
278278
let cmd = substitute(cmd, '-u NONE', '--clean', '')
279279
let cmd = substitute(cmd, '--not-a-term', '', '')
280280

281+
" Force using utf-8, Vim may pick up something else from the environment.
282+
let cmd ..= ' --cmd "set enc=utf8" '
283+
281284
" Optionally run Vim under valgrind
282285
" let cmd = 'valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind ' . cmd
283286

src/testdir/test_popupwin.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,6 @@ func Test_popup_never_behind()
13781378
" | |
13791379
" +-----------------------------+
13801380
let lines =<< trim END
1381-
only
13821381
split
13831382
vsplit
13841383
let info_window1 = getwininfo()[0]
@@ -1649,11 +1648,12 @@ func Test_notifications()
16491648
CheckFeature timers
16501649
CheckScreendump
16511650

1652-
call writefile([
1653-
\ "call setline(1, range(1, 20))",
1654-
\ "hi Notification ctermbg=lightblue",
1655-
\ "call popup_notification('first notification', {})",
1656-
\], 'XtestNotifications')
1651+
let lines =<< trim END
1652+
call setline(1, range(1, 20))
1653+
hi Notification ctermbg=lightblue
1654+
call popup_notification('first notification', {})
1655+
END
1656+
call writefile(lines, 'XtestNotifications')
16571657
let buf = RunVimInTerminal('-S XtestNotifications', #{rows: 10})
16581658
call VerifyScreenDump(buf, 'Test_popupwin_notify_01', {})
16591659

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1956,
764766
/**/
765767
1955,
766768
/**/

0 commit comments

Comments
 (0)