0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.1.0811: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, the final chapter.
This commit is contained in:
Bram Moolenaar
2019-01-24 17:59:39 +01:00
parent 264b74fa54
commit 30276f2beb
54 changed files with 121 additions and 324 deletions

View File

@@ -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ḃḇ"))