Mercurial > vim
comparison src/testdir/test_termencoding.vim @ 15504:247511eadb7a v8.1.0760
patch 8.1.0760: no proper test for using 'termencoding'
commit https://github.com/vim/vim/commit/617d7ef0462e86ec946d8932e4d157e65bbc9aa8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 17 13:04:30 2019 +0100
patch 8.1.0760: no proper test for using 'termencoding'
Problem: No proper test for using 'termencoding'.
Solution: Add a screendump test. Fix using double width characters in a
screendump.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Jan 2019 13:15:07 +0100 |
parents | |
children | 2dcaa860e3fc |
comparison
equal
deleted
inserted
replaced
15503:65eb414db805 | 15504:247511eadb7a |
---|---|
1 " Test for setting 'encoding' to something else than the terminal uses, then | |
2 " setting 'termencoding' to make it work. | |
3 | |
4 " This only works with "iconv". | |
5 if !has('multi_byte') || !has('iconv') | |
6 finish | |
7 endif | |
8 | |
9 source screendump.vim | |
10 if !CanRunVimInTerminal() | |
11 finish | |
12 endif | |
13 | |
14 " This Vim is running with 'encoding' "utf-8", the Vim in the terminal is | |
15 " running with 'encoding' "euc-jp". We need to make sure the text is in the | |
16 " right encoding, this is a bit tricky. | |
17 func Test_termencoding_euc_jp() | |
18 new | |
19 call setline(1, 'E89: バッファ %ld の変更は保存されていません (! で変更を破棄)') | |
20 write ++enc=euc-jp Xeuc_jp.txt | |
21 quit | |
22 | |
23 call writefile([ | |
24 \ 'set encoding=euc-jp', | |
25 \ 'set termencoding=utf-8', | |
26 \ 'scriptencoding utf-8', | |
27 \ 'exe "normal aE83: バッファを作成できないので、他のを使用します...\<Esc>"', | |
28 \ 'split Xeuc_jp.txt', | |
29 \ ], 'XTest_tenc_euc_jp') | |
30 let buf = RunVimInTerminal('-S XTest_tenc_euc_jp', {'rows': 10}) | |
31 call VerifyScreenDump(buf, 'Test_tenc_euc_jp_01', {}) | |
32 | |
33 " clean up | |
34 call StopVimInTerminal(buf) | |
35 call delete('Xeuc_jp.txt') | |
36 call delete('XTest_tenc_euc_jp') | |
37 endfunc |