diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-24 17:59:39 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-24 17:59:39 +0100 |
commit | 30276f2beb248557c6b33cd5418bca8b7084b0a5 (patch) | |
tree | 56f7b88712a5ffffdd10681983e70501e2e1ba58 /src/testdir | |
parent | 264b74fa545edfb92c0d7d08a02c26331cc5b168 (diff) |
patch 8.1.0811: too many #ifdefsv8.1.0811
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, the final chapter.
Diffstat (limited to 'src/testdir')
41 files changed, 95 insertions, 245 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index a8b43aaed9..3f49ccb1cb 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -49,13 +49,9 @@ source setup.vim " This also enables use of line continuation. set nocp viminfo+=nviminfo -" Use utf-8 or latin1 by default, instead of whatever the system default -" happens to be. Individual tests can overrule this at the top of the file. -if has('multi_byte') - set encoding=utf-8 -else - set encoding=latin1 -endif +" Use utf-8 by default, instead of whatever the system default happens to be. +" Individual tests can overrule this at the top of the file. +set encoding=utf-8 " REDIR_TEST_TO_NULL has a very permissive SwapExists autocommand which is for " the test_name.vim file itself. Replace it here with a more restrictive one, diff --git a/src/testdir/test_alot_utf8.vim b/src/testdir/test_alot_utf8.vim index 648d806a94..be0bd01413 100644 --- a/src/testdir/test_alot_utf8.vim +++ b/src/testdir/test_alot_utf8.vim @@ -2,8 +2,7 @@ " This makes testing go faster, since Vim doesn't need to restart. " These tests use utf8 'encoding'. Setting 'encoding' is already done in -" runtest.vim. Checking for the multi_byte feature is in the individual -" files, so that they can be run by themselves. +" runtest.vim. source test_charsearch_utf8.vim source test_expr_utf8.vim diff --git a/src/testdir/test_arabic.vim b/src/testdir/test_arabic.vim index 17e925ee7f..bc31db7e7c 100644 --- a/src/testdir/test_arabic.vim +++ b/src/testdir/test_arabic.vim @@ -2,7 +2,7 @@ " NOTE: This just checks if the code works. If you know Arabic please add " functional tests that check the shaping works with real text. -if !has('arabic') || !has('multi_byte') +if !has('arabic') finish endif diff --git a/src/testdir/test_charsearch_utf8.vim b/src/testdir/test_charsearch_utf8.vim index 399ac51c48..82a807ac5b 100644 --- a/src/testdir/test_charsearch_utf8.vim +++ b/src/testdir/test_charsearch_utf8.vim @@ -1,7 +1,4 @@ " Tests for related f{char} and t{char} using utf-8. -if !has('multi_byte') - finish -endif " Test for t,f,F,T movement commands func Test_search_cmds() diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 9a4ccd11d5..4dcda858e8 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -582,7 +582,7 @@ func Test_setcmdpos() endfunc func Test_cmdline_overstrike() - let encodings = has('multi_byte') ? [ 'latin1', 'utf8' ] : [ 'latin1' ] + let encodings = ['latin1', 'utf8'] let encoding_save = &encoding for e in encodings @@ -601,11 +601,9 @@ func Test_cmdline_overstrike() call assert_equal('"ab0cd3ef4', @:) endfor - if has('multi_byte') - " Test overstrike with multi-byte characters. - call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') - call assert_equal('"テabキcdエディタ', @:) - endif + " Test overstrike with multi-byte characters. + call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') + call assert_equal('"テabキcdエディタ', @:) let &encoding = encoding_save endfunc diff --git a/src/testdir/test_digraph.vim b/src/testdir/test_digraph.vim index d5b0a7b72e..8d56a1a247 100644 --- a/src/testdir/test_digraph.vim +++ b/src/testdir/test_digraph.vim @@ -1,6 +1,6 @@ " Tests for digraphs -if !has("digraphs") || !has("multi_byte") +if !has("digraphs") finish endif @@ -466,9 +466,6 @@ func Test_show_digraph() endfunc func Test_show_digraph_cp1251() - if !has('multi_byte') - return - endif new set encoding=cp1251 call Put_Dig("='") diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim index e0e3e3b54c..81ffb2c944 100644 --- a/src/testdir/test_display.vim +++ b/src/testdir/test_display.vim @@ -39,7 +39,7 @@ func Test_display_foldcolumn() endfunc func Test_display_foldtext_mbyte() - if !has("folding") || !has("multi_byte") + if !has("folding") return endif call NewWindow(10, 40) diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 7b31469632..9a60d018e1 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -37,12 +37,10 @@ func Test_edit_01() call assert_equal([''], getline(1,'$')) %d " 4) delete a multibyte character - if has("multi_byte") - call setline(1, "\u0401") - call feedkeys("i\<del>\<esc>", 'tnix') - call assert_equal([''], getline(1,'$')) - %d - endif + call setline(1, "\u0401") + call feedkeys("i\<del>\<esc>", 'tnix') + call assert_equal([''], getline(1,'$')) + %d " 5.1) delete linebreak with 'bs' option containing eol let _bs=&bs set bs=eol @@ -440,7 +438,7 @@ endfunc func Test_edit_CTRL_() " disabled for Windows builds, why? - if !has("multi_byte") || !has("rightleft") || has("win32") + if !has("rightleft") || has("win32") return endif let _encoding=&encoding @@ -608,15 +606,14 @@ func Test_edit_CTRL_K() endtry call delete('Xdictionary.txt') - if has("multi_byte") - call test_override("char_avail", 1) - set showcmd - %d - call feedkeys("A\<c-k>a:\<esc>", 'tnix') - call assert_equal(['ä'], getline(1, '$')) - call test_override("char_avail", 0) - set noshowcmd - endif + call test_override("char_avail", 1) + set showcmd + %d + call feedkeys("A\<c-k>a:\<esc>", 'tnix') + call assert_equal(['ä'], getline(1, '$')) + call test_override("char_avail", 0) + set noshowcmd + bw! endfunc diff --git a/src/testdir/test_erasebackword.vim b/src/testdir/test_erasebackword.vim index 098d6edfcb..9522ec2cd6 100644 --- a/src/testdir/test_erasebackword.vim +++ b/src/testdir/test_erasebackword.vim @@ -1,10 +1,5 @@ func Test_erasebackword() - if !has('multi_byte') - return - endif - - set encoding=utf-8 enew exe "normal o wwwこんにちわ世界ワールドvim \<C-W>" @@ -21,5 +16,4 @@ func Test_erasebackword() call assert_equal('', getline('.')) enew! - set encoding& endfunc diff --git a/src/testdir/test_expr_utf8.vim b/src/testdir/test_expr_utf8.vim index 1737a9f745..fad725d2e5 100644 --- a/src/testdir/test_expr_utf8.vim +++ b/src/testdir/test_expr_utf8.vim @@ -1,7 +1,4 @@ " Tests for expressions using utf-8. -if !has('multi_byte') - finish -endif func Test_strgetchar() call assert_equal(char2nr('á'), strgetchar('áxb', 0)) diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index d942d07687..3d8104817d 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -106,11 +106,9 @@ func Test_strwidth() call assert_equal(4, strwidth(1234)) call assert_equal(5, strwidth(-1234)) - if has('multi_byte') - call assert_equal(2, strwidth('😉')) - call assert_equal(17, strwidth('Eĥoŝanĝo ĉiuĵaŭde')) - call assert_equal((aw == 'single') ? 6 : 7, strwidth('Straße')) - endif + call assert_equal(2, strwidth('😉')) + call assert_equal(17, strwidth('Eĥoŝanĝo ĉiuĵaŭde')) + call assert_equal((aw == 'single') ? 6 : 7, strwidth('Straße')) call assert_fails('call strwidth({->0})', 'E729:') call assert_fails('call strwidth([])', 'E730:') @@ -277,10 +275,8 @@ func Test_strpart() call assert_equal('fg', strpart('abcdefg', 5, 4)) call assert_equal('defg', strpart('abcdefg', 3)) - if has('multi_byte') - call assert_equal('lép', strpart('éléphant', 2, 4)) - call assert_equal('léphant', strpart('éléphant', 2)) - endif + call assert_equal('lép', strpart('éléphant', 2, 4)) + call assert_equal('léphant', strpart('éléphant', 2)) endfunc func Test_tolower() @@ -290,10 +286,6 @@ func Test_tolower() call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~', \ tolower(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~')) - if !has('multi_byte') - return - endif - " Test with a few uppercase diacritics. call assert_equal("aàáâãäåāăąǎǟǡả", tolower("AÀÁÂÃÄÅĀĂĄǍǞǠẢ")) call assert_equal("bḃḇ", tolower("BḂḆ")) @@ -368,10 +360,6 @@ func Test_toupper() call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~', \ toupper(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~')) - if !has('multi_byte') - return - endif - " Test with a few lowercase diacritics. call assert_equal("AÀÁÂÃÄÅĀĂĄǍǞǠẢ", toupper("aàáâãäåāăąǎǟǡả")) call assert_equal("BḂḆ", toupper("bḃḇ")) diff --git a/src/testdir/test_ga.vim b/src/testdir/test_ga.vim index 6a7cba28f0..ea3d211aeb 100644 --- a/src/testdir/test_ga.vim +++ b/src/testdir/test_ga.vim @@ -21,10 +21,6 @@ func Test_ga_command() call assert_equal("\n<e> 101, Hex 65, Octal 145", Do_ga('e')) - if !has('multi_byte') - return - endif - " Test a few multi-bytes characters. call assert_equal("\n<é> 233, Hex 00e9, Oct 351, Digr e'", Do_ga('é')) call assert_equal("\n<ẻ> 7867, Hex 1ebb, Oct 17273, Digr e2", Do_ga('ẻ')) diff --git a/src/testdir/test_iminsert.vim b/src/testdir/test_iminsert.vim index 142aec0bac..1a8e4c8a14 100644 --- a/src/testdir/test_iminsert.vim +++ b/src/testdir/test_iminsert.vim @@ -1,7 +1,3 @@ -if !has('multi_byte') - finish -endif - source view_util.vim let s:imactivatefunc_called = 0 diff --git a/src/testdir/test_increment_dbcs.vim b/src/testdir/test_increment_dbcs.vim index dea405c633..80b81acc79 100644 --- a/src/testdir/test_increment_dbcs.vim +++ b/src/testdir/test_increment_dbcs.vim @@ -1,7 +1,4 @@ " Tests for using Ctrl-A/Ctrl-X using DBCS. -if !has('multi_byte') - finish -endif set encoding=cp932 scriptencoding cp932 diff --git a/src/testdir/test_json.vim b/src/testdir/test_json.vim index e0a550c844..fb3d9927e4 100644 --- a/src/testdir/test_json.vim +++ b/src/testdir/test_json.vim @@ -1,10 +1,5 @@ " Test for JSON functions. -" JSON requires using utf-8, because conversion breaks the asserts. -if !has('multi_byte') - finish -endif - let s:json1 = '"str\"in\\g"' let s:var1 = "str\"in\\g" let s:json2 = '"\u0001\u0002\u0003\u0004\u0005\u0006\u0007"' @@ -79,10 +74,8 @@ func Test_json_encode() call assert_equal(s:json4, json_encode(s:var4)) call assert_equal(s:json5, json_encode(s:var5)) - if has('multi_byte') - call assert_equal(s:jsonmb, json_encode(s:varmb)) - " no test for surrogate pair, json_encode() doesn't create them. - endif + call assert_equal(s:jsonmb, json_encode(s:varmb)) + " no test for surrogate pair, json_encode() doesn't create them. call assert_equal(s:jsonnr, json_encode(s:varnr)) if has('float') @@ -121,11 +114,9 @@ func Test_json_decode() call assert_equal(s:var4, json_decode(s:json4)) call assert_equal(s:var5, json_decode(s:json5)) - if has('multi_byte') - call assert_equal(s:varmb, json_decode(s:jsonmb)) - call assert_equal(s:varsp1, json_decode(s:jsonsp1)) - call assert_equal(s:varsp2, json_decode(s:jsonsp2)) - endif + call assert_equal(s:varmb, json_decode(s:jsonmb)) + call assert_equal(s:varsp1, json_decode(s:jsonsp1)) + call assert_equal(s:varsp2, json_decode(s:jsonsp2)) call assert_equal(s:varnr, json_decode(s:jsonnr)) if has('float') @@ -197,10 +188,8 @@ func Test_js_encode() call assert_equal(s:json4, js_encode(s:var4)) call assert_equal(s:json5, js_encode(s:var5)) - if has('multi_byte') - call assert_equal(s:jsonmb, js_encode(s:varmb)) - " no test for surrogate pair, js_encode() doesn't create them. - endif + call assert_equal(s:jsonmb, js_encode(s:varmb)) + " no test for surrogate pair, js_encode() doesn't create them. call assert_equal(s:jsonnr, js_encode(s:varnr)) if has('float') @@ -237,11 +226,9 @@ func Test_js_decode() call assert_equal(s:var4, js_decode(s:json4)) call assert_equal(s:var5, js_decode(s:json5)) - if has('multi_byte') - call assert_equal(s:varmb, js_decode(s:jsonmb)) - call assert_equal(s:varsp1, js_decode(s:jsonsp1)) - call assert_equal(s:varsp2, js_decode(s:jsonsp2)) - endif + call assert_equal(s:varmb, js_decode(s:jsonmb)) + call assert_equal(s:varsp1, js_decode(s:jsonsp1)) + call assert_equal(s:varsp2, js_decode(s:jsonsp2)) call assert_equal(s:varnr, js_decode(s:jsonnr)) if has('float') diff --git a/src/testdir/test_makeencoding.vim b/src/testdir/test_makeencoding.vim index a3d5538a47..d18b3b6de8 100644 --- a/src/testdir/test_makeencoding.vim +++ b/src/testdir/test_makeencoding.vim @@ -1,7 +1,4 @@ " Tests for 'makeencoding'. -if !has('multi_byte') - finish -endif source shared.vim diff --git a/src/testdir/test_maparg.vim b/src/testdir/test_maparg.vim index c9e440edc0..86e046b5d6 100644 --- a/src/testdir/test_maparg.vim +++ b/src/testdir/test_maparg.vim @@ -1,8 +1,5 @@ " Tests for maparg(). " Also test utf8 map with a 0x80 byte. -if !has("multi_byte") - finish -endif function s:SID() return str2nr(matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')) diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 4ac06a10c9..5aaa743fad 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -1,9 +1,5 @@ " Tests for mappings and abbreviations -if !has('multi_byte') - finish -endif - func Test_abbreviation() " abbreviation with 0x80 should work inoreab чкпр vim diff --git a/src/testdir/test_marks.vim b/src/testdir/test_marks.vim index 70c4e83adb..2fb95a5362 100644 --- a/src/testdir/test_marks.vim +++ b/src/testdir/test_marks.vim @@ -122,9 +122,6 @@ func Test_marks_cmd() endfunc func Test_marks_cmd_multibyte() - if !has('multi_byte') - return - endif new Xone call setline(1, [repeat('á', &columns)]) norm! ma diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 70f049099f..94bca9ad38 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -114,36 +114,33 @@ function Test_match() call assert_equal([{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}], getmatches()) call clearmatches() - " - if has('multi_byte') - call setline(1, 'abcdΣabcdef') - call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]]) - 1 - redraw! - let v1 = screenattr(1, 1) - let v4 = screenattr(1, 4) - let v5 = screenattr(1, 5) - let v6 = screenattr(1, 6) - let v7 = screenattr(1, 7) - let v8 = screenattr(1, 8) - let v9 = screenattr(1, 9) - let v10 = screenattr(1, 10) - call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches()) - call assert_notequal(v1, v4) - call assert_equal(v5, v4) - call assert_equal(v6, v1) - call assert_equal(v7, v1) - call assert_equal(v8, v4) - call assert_equal(v9, v4) - call assert_equal(v10, v1) - - " Check, that setmatches() can correctly restore the matches from matchaddpos() - call matchadd('MyGroup1', '\%2lmatchadd') - let m=getmatches() - call clearmatches() - call setmatches(m) - call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches()) - endif + call setline(1, 'abcdΣabcdef') + call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]]) + 1 + redraw! + let v1 = screenattr(1, 1) + let v4 = screenattr(1, 4) + let v5 = screenattr(1, 5) + let v6 = screenattr(1, 6) + let v7 = screenattr(1, 7) + let v8 = screenattr(1, 8) + let v9 = screenattr(1, 9) + let v10 = screenattr(1, 10) + call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches()) + call assert_notequal(v1, v4) + call assert_equal(v5, v4) + call assert_equal(v6, v1) + call assert_equal(v7, v1) + call assert_equal(v8, v4) + call assert_equal(v9, v4) + call assert_equal(v10, v1) + + " Check, that setmatches() can correctly restore the matches from matchaddpos() + call matchadd('MyGroup1', '\%2lmatchadd') + let m=getmatches() + call clearmatches() + call setmatches(m) + call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches()) highlight MyGroup1 NONE highlight MyGroup2 NONE diff --git a/src/testdir/test_matchadd_conceal_utf8.vim b/src/testdir/test_matchadd_conceal_utf8.vim index 68792fbcb5..d280c153ac 100644 --- a/src/testdir/test_matchadd_conceal_utf8.vim +++ b/src/testdir/test_matchadd_conceal_utf8.vim @@ -1,5 +1,5 @@ " Test for matchadd() and conceal feature using utf-8. -if !has('conceal') || !has('multi_byte') +if !has('conceal') finish endif diff --git a/src/testdir/test_mksession_utf8.vim b/src/testdir/test_mksession_utf8.vim index 8ffbba2a1c..67af3a9ca2 100644 --- a/src/testdir/test_mksession_utf8.vim +++ b/src/testdir/test_mksession_utf8.vim @@ -3,7 +3,7 @@ set encoding=utf-8 scriptencoding utf-8 -if !has('multi_byte') || !has('mksession') +if !has('mksession') finish endif diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index aac75da71b..1224a3f7da 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1368,10 +1368,6 @@ func Test_normal23_K() endfunc func Test_normal24_rot13() - " This test uses multi byte characters - if !has("multi_byte") - return - endif " Testing for g?? g?g? new call append(0, 'abcdefghijklmnopqrstuvwxyzäüö') @@ -1621,10 +1617,6 @@ fun! Test_normal29_brace() endfunc fun! Test_normal30_changecase() - " This test uses multi byte characters - if !has("multi_byte") - return - endif new call append(0, 'This is a simple test: äüöß') norm! 1ggVu @@ -1894,42 +1886,36 @@ func Test_g_ctrl_g() call assert_equal("\nCol 1 of 10; Line 1 of 2; Word 1 of 4; Char 1 of 23; Byte 1 of 22", a) set bin & eol& - if has('multi_byte') - call setline(1, ['Français', '日本語']) + call setline(1, ['Français', '日本語']) - let a = execute(":norm! \<Esc>gojlg\<c-g>") - call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20", a) + let a = execute(":norm! \<Esc>gojlg\<c-g>") + call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20", a) - let a = execute(":norm! \<Esc>gojvlg\<c-g>") - call assert_equal("\nSelected 1 of 2 Lines; 1 of 2 Words; 2 of 13 Chars; 6 of 20 Bytes", a) + let a = execute(":norm! \<Esc>gojvlg\<c-g>") + call assert_equal("\nSelected 1 of 2 Lines; 1 of 2 Words; 2 of 13 Chars; 6 of 20 Bytes", a) - let a = execute(":norm! \<Esc>goll\<c-v>jlg\<c-g>") - call assert_equal("\nSelected 4 Cols; 2 of 2 Lines; 2 of 2 Words; 6 of 13 Chars; 11 of 20 Bytes", a) + let a = execute(":norm! \<Esc>goll\<c-v>jlg\<c-g>") + call assert_equal("\nSelected 4 Cols; 2 of 2 Lines; 2 of 2 Words; 6 of 13 Chars; 11 of 20 Bytes", a) - set fenc=utf8 bomb - let a = execute(":norm! \<Esc>gojlg\<c-g>") - call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+3 for BOM)", a) + set fenc=utf8 bomb + let a = execute(":norm! \<Esc>gojlg\<c-g>") + call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+3 for BOM)", a) - set fenc=utf16 bomb - let a = execute(":norm! g\<c-g>") - call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+2 for BOM)", a) + set fenc=utf16 bomb + let a = execute(":norm! g\<c-g>") + call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+2 for BOM)", a) - set fenc=utf32 bomb - let a = execute(":norm! g\<c-g>") - call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+4 for BOM)", a) + set fenc=utf32 bomb + let a = execute(":norm! g\<c-g>") + call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+4 for BOM)", a) - set fenc& bomb& - endif + set fenc& bomb& set ff& bwipe! endfunc fun! Test_normal34_g_cmd3() - if !has("multi_byte") - return - endif - " Test for g8 new let a=execute(':norm! 1G0g8') @@ -1948,9 +1934,6 @@ fun! Test_normal34_g_cmd3() endfunc func Test_normal_8g8() - if !has("multi_byte") - return - endif new " Test 8g8 which finds invalid utf8 at or after the cursor. @@ -2290,11 +2273,6 @@ func Test_normal45_drop() endfunc func Test_normal46_ignore() - " This test uses multi byte characters - if !has("multi_byte") - return - endif - new " How to test this? " let's just for now test, that the buffer @@ -2470,9 +2448,7 @@ func Test_normal54_Ctrl_bsl() call assert_equal(['abcdefghijklmn'], getline(1,'$')) exe "norm! df\<c-\>m" call assert_equal(['abcdefghijklmn'], getline(1,'$')) - if !has("multi_byte") - return - endif + call setline(2, 'abcdefghijklmnāf') norm! 2gg0 exe "norm! df\<Char-0x101>" @@ -2494,9 +2470,6 @@ func Test_normal_large_count() endfunc func Test_delete_until_paragraph() - if !has('multi_byte') - return - endif new normal grádv} call assert_equal('á', getline(1)) diff --git a/src/testdir/test_plus_arg_edit.vim b/src/testdir/test_plus_arg_edit.vim index e91a6e467a..e31680e7b6 100644 --- a/src/testdir/test_plus_arg_edit.vim +++ b/src/testdir/test_plus_arg_edit.vim @@ -10,10 +10,6 @@ function Test_edit() endfunction func Test_edit_bad() - if !has('multi_byte') - finish - endif - " Test loading a utf8 file with bad utf8 sequences. call writefile(["[\xff][\xc0][\xe2\x89\xf0][\xc2\xc2]"], "Xfile") new diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim index 1d4952317b..d6e9c03bd5 100644 --- a/src/testdir/test_profile.vim +++ b/src/testdir/test_profile.vim @@ -407,7 +407,7 @@ func Test_profile_errors() endfunc func Test_profile_truncate_mbyte() - if !has('multi_byte') || &enc !=# 'utf-8' + if &enc !=# 'utf-8' return endif diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim index 61b74297ff..2a9e8a3c03 100644 --- a/src/testdir/test_put.vim +++ b/src/testdir/test_put.vim @@ -1,9 +1,6 @@ " Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc. func Test_put_block() - if !has('multi_byte') - return - endif new call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x') call feedkeys("\<C-V>y", 'x') diff --git a/src/testdir/test_regex_char_classes.vim b/src/testdir/test_regex_char_classes.vim index 7873502943..c1a4202c2b 100644 --- a/src/testdir/test_regex_char_classes.vim +++ b/src/testdir/test_regex_char_classes.vim |