diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2015-06-30 11:32:14 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2015-09-08 10:54:31 +0200 |
commit | ffff2c9c47e63f1764ca743810a259d607f75104 (patch) | |
tree | 820bbb33a041793b198416210adf1d15ec295ac2 | |
parent | e99368104ac5883742c44f8d21692af878257d7b (diff) | |
download | rneovim-ffff2c9c47e63f1764ca743810a259d607f75104.tar.gz rneovim-ffff2c9c47e63f1764ca743810a259d607f75104.tar.bz2 rneovim-ffff2c9c47e63f1764ca743810a259d607f75104.zip |
encoding: Update handling of encoding in tests
Always run tests with encoding=utf-8, regardless of user locale
Don't set &encoding after startup in tests
Helped-By: Michael Reed <m.reed@mykolab.com>
-rw-r--r-- | src/nvim/testdir/test10.in | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test39.in | 14 | ||||
-rw-r--r-- | src/nvim/testdir/test39.ok | bin | 584 -> 585 bytes | |||
-rw-r--r-- | src/nvim/testdir/test69.in | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test83.in | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_eval.in | 1 | ||||
-rw-r--r-- | src/nvim/testdir/unix.vim | 3 | ||||
-rw-r--r-- | test/functional/helpers.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/legacy/075_maparg_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/legacy/082_string_comparison_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/legacy/095_regexp_multibyte_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/mapping_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/utf8_spec.lua | 1 |
14 files changed, 11 insertions, 20 deletions
diff --git a/src/nvim/testdir/test10.in b/src/nvim/testdir/test10.in index 2d0d546606..769d690acb 100644 --- a/src/nvim/testdir/test10.in +++ b/src/nvim/testdir/test10.in @@ -4,7 +4,6 @@ STARTTEST :so small.vim :" Also test a BOM is ignored. :so mbyte.vim -:set encoding=utf-8 :7/start of errorfile/,/end of errorfile/w! Xerrorfile1 :7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2 :/start of testfile/,/end of testfile/w! Xtestfile diff --git a/src/nvim/testdir/test39.in b/src/nvim/testdir/test39.in index c4e46fff26..ebbcbd6d0d 100644 --- a/src/nvim/testdir/test39.in +++ b/src/nvim/testdir/test39.in @@ -5,8 +5,6 @@ And test "U" in Visual mode, also on German sharp S. STARTTEST :so small.vim :so mbyte.vim -:" This only works when 'encoding' is "latin1", don't depend on the environment -:set enc=latin1 /^abcde :" Test shift-right of a block jlllljj>wlljlll> @@ -39,18 +37,18 @@ G$khhhhhkkcmno :exe ":norm! l\<C-V>j$hhAab\<Esc>" :.,/^$/w >> test.out :" Test for Visual block insert when virtualedit=all and utf-8 encoding -:set ve=all enc=utf-8 +:set ve=all :/\t\tline :exe ":norm! 07l\<C-V>jjIx\<Esc>" :.,/^$/w >> test.out :" Test for Visual block append when virtualedit=all :exe ":norm! 012l\<C-v>jjAx\<Esc>" -:set ve= enc=latin1 +:set ve= :.,/^$/w >> test.out -:" gUe must uppercase a whole word, also when changes to SS -Gothe youtueuu endYpk0wgUe +:" gUe must uppercase a whole word, also when ß changes to SS +Gothe youtußeuu endYpk0wgUe :" gUfx must uppercase until x, inclusive. -O- youtuexu -0fogUfx +O- youßtußexu -0fogUfx :" VU must uppercase a whole line YpkVU :" same, when it's the last line in the buffer @@ -89,7 +87,7 @@ cccc dddd yaaa - +¿¿¿ bbb A23 diff --git a/src/nvim/testdir/test39.ok b/src/nvim/testdir/test39.ok Binary files differindex 5c517e2223..198e5b14dc 100644 --- a/src/nvim/testdir/test39.ok +++ b/src/nvim/testdir/test39.ok diff --git a/src/nvim/testdir/test69.in b/src/nvim/testdir/test69.in index 26f41e8a29..f583947dfb 100644 --- a/src/nvim/testdir/test69.in +++ b/src/nvim/testdir/test69.in @@ -5,7 +5,6 @@ Also test byteidx() and byteidxcomp() STARTTEST :so mbyte.vim -:set encoding=utf-8 ENDTEST Results of test69: diff --git a/src/nvim/testdir/test83.in b/src/nvim/testdir/test83.in index 297d560d2f..d54b1bcddd 100644 --- a/src/nvim/testdir/test83.in +++ b/src/nvim/testdir/test83.in @@ -2,7 +2,6 @@ Tests for tag search with !_TAG_FILE_ENCODING. STARTTEST :so mbyte.vim -:set enc=utf8 :if !has('iconv') || iconv("\x82\x60", "cp932", "utf-8") != "\uff21" : e! test.ok : w! test.out diff --git a/src/nvim/testdir/test_eval.in b/src/nvim/testdir/test_eval.in index 328ee2e127..b2b982a434 100644 --- a/src/nvim/testdir/test_eval.in +++ b/src/nvim/testdir/test_eval.in @@ -4,7 +4,6 @@ Note: system clipboard is saved, changed and restored. STARTTEST :so small.vim -:set encoding=latin1 :set noswapfile :lang C :fun AppendRegContents(reg) diff --git a/src/nvim/testdir/unix.vim b/src/nvim/testdir/unix.vim index f766e74c30..aa1f6a92bc 100644 --- a/src/nvim/testdir/unix.vim +++ b/src/nvim/testdir/unix.vim @@ -1,3 +1,6 @@ " Settings for test script execution " Always use "sh", don't use the value of "$SHELL". set shell=sh + +" Don't depend on system locale, always use utf-8 +set encoding=utf-8 diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index f228f6290c..6c0288087a 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -7,7 +7,7 @@ local Session = require('nvim.session') local nvim_prog = os.getenv('NVIM_PROG') or 'build/bin/nvim' local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', - '--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1', + '--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1 encoding=utf-8', '--embed'} -- Formulate a path to the directory containing nvim. We use this to diff --git a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua index 58838e9d6e..efe61aa354 100644 --- a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua +++ b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua @@ -33,7 +33,6 @@ local function run_test_with_regexpengine(regexpengine) j 0123❤x k combinations]]) - execute('set encoding=utf-8') execute('set re=' .. regexpengine) -- Lines 1-8. Exercise regexp search with various magic settings. On each diff --git a/test/functional/legacy/075_maparg_spec.lua b/test/functional/legacy/075_maparg_spec.lua index dac8940314..418abb14d4 100644 --- a/test/functional/legacy/075_maparg_spec.lua +++ b/test/functional/legacy/075_maparg_spec.lua @@ -10,7 +10,6 @@ describe('maparg()', function() it('is working', function() execute('set cpo-=<') - execute('set encoding=utf8') -- Test maparg() with a string result execute('map foo<C-V> is<F4>foo') diff --git a/test/functional/legacy/082_string_comparison_spec.lua b/test/functional/legacy/082_string_comparison_spec.lua index bd4e8a4d79..1615828ca0 100644 --- a/test/functional/legacy/082_string_comparison_spec.lua +++ b/test/functional/legacy/082_string_comparison_spec.lua @@ -9,7 +9,6 @@ describe('case-insensitive string comparison in UTF-8', function() setup(clear) it('is working', function() - execute('set enc=utf8') feed('ggdG<cr>') source([[ function! Ch(a, op, b, expected) diff --git a/test/functional/legacy/095_regexp_multibyte_spec.lua b/test/functional/legacy/095_regexp_multibyte_spec.lua index a72fb669d2..559222e2ff 100644 --- a/test/functional/legacy/095_regexp_multibyte_spec.lua +++ b/test/functional/legacy/095_regexp_multibyte_spec.lua @@ -15,7 +15,7 @@ describe('regex with multi-byte', function() Results of test95:]]) source([=[ - set encoding=utf-8 nomore + set nomore let tl = [] call add(tl, [2, '[[:alpha:][=a=]]\+', '879 aiaãâaiuvna ', 'aiaãâaiuvna']) diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index 0843506827..899f7423d0 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -12,8 +12,6 @@ describe('mapping', function() test starts here: ]]) - execute('set encoding=utf-8') - -- Abbreviations with р (0x80) should work. execute('inoreab чкпр vim') feed('GAчкпр <esc>') diff --git a/test/functional/legacy/utf8_spec.lua b/test/functional/legacy/utf8_spec.lua index d26f436057..ef717042d0 100644 --- a/test/functional/legacy/utf8_spec.lua +++ b/test/functional/legacy/utf8_spec.lua @@ -10,7 +10,6 @@ describe('utf8', function() it('is working', function() insert('start:') - execute('set encoding=utf-8') execute('new') execute('call setline(1, ["aaa", "あああ", "bbb"])') |