view src/testdir/test52.in @ 17555:c2eb5118ba89 v8.1.1775

patch 8.1.1775: error message may be empty in filetype test commit https://github.com/vim/vim/commit/eee9f65b2a213e9031f172d9d3b22adad6cb985d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 29 21:14:42 2019 +0200 patch 8.1.1775: error message may be empty in filetype test Problem: Error message may be empty in filetype test. Solution: Use v:exception instead. (Daniel Hahler, closs https://github.com/vim/vim/issues/4744)
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Jul 2019 21:15:08 +0200
parents 3fc0f57ecb91
children
line wrap: on
line source

Tests for reading and writing files with conversion for Win32.

STARTTEST
:so mbyte.vim
:" make this a dummy test for non-Win32 systems
:if !has("win32") | e! test.ok | wq! test.out | endif
:"
:" write tests:
:" combine three values for 'encoding' with three values for 'fileencoding'
:" also write files for read tests
/^1
:set encoding=utf-8
:.w! ++enc=utf-8 test.out
:.w ++enc=cp1251 >>test.out
:.w ++enc=cp866 >>test.out
:.w! ++enc=utf-8 Xutf8
/^2
:set encoding=cp1251
:.w ++enc=utf-8 >>test.out
:.w ++enc=cp1251 >>test.out
:.w ++enc=cp866 >>test.out
:.w! ++enc=cp1251 Xcp1251
/^3
:set encoding=cp866
:.w ++enc=utf-8 >>test.out
:.w ++enc=cp1251 >>test.out
:.w ++enc=cp866 >>test.out
:.w! ++enc=cp866 Xcp866
:"
:" read three 'fileencoding's with utf-8 'encoding'
:set encoding=utf-8 fencs=utf-8,cp1251
:e Xutf8
:.w ++enc=utf-8 >>test.out
:e Xcp1251
:.w ++enc=utf-8 >>test.out
:set fencs=utf-8,cp866
:e Xcp866
:.w ++enc=utf-8 >>test.out
:"
:" read three 'fileencoding's with cp1251 'encoding'
:set encoding=utf-8 fencs=utf-8,cp1251
:e Xutf8
:.w ++enc=cp1251 >>test.out
:e Xcp1251
:.w ++enc=cp1251 >>test.out
:set fencs=utf-8,cp866
:e Xcp866
:.w ++enc=cp1251 >>test.out
:"
:" read three 'fileencoding's with cp866 'encoding'
:set encoding=cp866 fencs=utf-8,cp1251
:e Xutf8
:.w ++enc=cp866 >>test.out
:e Xcp1251
:.w ++enc=cp866 >>test.out
:set fencs=utf-8,cp866
:e Xcp866
:.w ++enc=cp866 >>test.out
:"
:qa!
ENDTEST

1 utf-8 text: Для Vim version 6.2.  Последнее изменение: 1970 Jan 01
2 cp1251 text:  Vim version 6.2.   : 1970 Jan 01
3 cp866 text:  Vim version 6.2.  ᫥ : 1970 Jan 01