Mercurial > vim
annotate src/testdir/test_termencoding.vim @ 22081:2b9a2bc77b42 v8.2.1590
patch 8.2.1590: Vim9: bufnr() doesn't take "true" argument
Commit: https://github.com/vim/vim/commit/fe136c9a85412f4bdb5de70ef8416af5fa382b28
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 4 18:35:26 2020 +0200
patch 8.2.1590: Vim9: bufnr() doesn't take "true" argument
Problem: Vim9: bufnr() doesn't take "true" argument.
Solution: use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6863)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 04 Sep 2020 18:45:04 +0200 |
parents | 08940efa6b4e |
children | c8ebe35b2475 |
rev | line source |
---|---|
15504
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test for setting 'encoding' to something else than the terminal uses, then |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 " setting 'termencoding' to make it work. |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 " This only works with "iconv". |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15504
diff
changeset
|
5 if !has('iconv') |
16965
ba7727889385
patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
6 throw 'Skipped: iconv feature missing' |
15504
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 endif |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 source screendump.vim |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 if !CanRunVimInTerminal() |
16965
ba7727889385
patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
11 throw 'Skipped: cannot make screendumps' |
15504
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 endif |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 " This Vim is running with 'encoding' "utf-8", the Vim in the terminal is |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 " running with 'encoding' "euc-jp". We need to make sure the text is in the |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 " right encoding, this is a bit tricky. |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 func Test_termencoding_euc_jp() |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 new |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 call setline(1, 'E89: バッファ %ld の変更は保存されていません (! で変更を破棄)') |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 write ++enc=euc-jp Xeuc_jp.txt |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 quit |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 call writefile([ |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 \ 'set encoding=euc-jp', |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 \ 'set termencoding=utf-8', |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 \ 'scriptencoding utf-8', |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 \ 'exe "normal aE83: バッファを作成できないので、他のを使用します...\<Esc>"', |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 \ 'split Xeuc_jp.txt', |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 \ ], 'XTest_tenc_euc_jp') |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 let buf = RunVimInTerminal('-S XTest_tenc_euc_jp', {'rows': 10}) |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 call VerifyScreenDump(buf, 'Test_tenc_euc_jp_01', {}) |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 " clean up |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 call StopVimInTerminal(buf) |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 call delete('Xeuc_jp.txt') |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 call delete('XTest_tenc_euc_jp') |
247511eadb7a
patch 8.1.0760: no proper test for using 'termencoding'
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
38 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
39 " vim: shiftwidth=2 sts=2 expandtab |