vim-patch:8.1.0811: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, the final chapter.
30276f2beb
This commit is contained in:
Daniel Hahler
2019-08-20 04:13:55 +02:00
parent 3223dedfc3
commit 77729b0800
34 changed files with 78 additions and 190 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:')
@@ -308,10 +306,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()
@@ -321,10 +317,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ḂḆ"))
@@ -399,10 +391,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ḃḇ"))