Mercurial > vim
diff src/testdir/test_normal.vim @ 14669:63d5ae57a663 v8.1.0347
patch 8.1.0347: some tests fail on Solaris
commit https://github.com/vim/vim/commit/f1c118be93184e8e57e3e80b1b3383f464ed649e
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 3 22:08:10 2018 +0200
patch 8.1.0347: some tests fail on Solaris
Problem: Some tests fail on Solaris.
Solution: Skip writefile test. Fix path to libc.so. Improve test for Turkish
case change. (Libor Bukata, Bjorn Linse, closes #3403)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 03 Sep 2018 22:15:17 +0200 |
parents | 335f32c55ac3 |
children | 1fd8e32532f7 |
line wrap: on
line diff
--- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1630,12 +1630,13 @@ fun! Test_normal30_changecase() norm! V~ call assert_equal('THIS IS A simple test: äüöss', getline('.')) - " Turkish ASCII turns to multi-byte. On Mac the Turkish locale is available - " but toupper()/tolower() don't do the right thing. - if !has('mac') && !has('osx') - try - lang tr_TR.UTF-8 - set casemap= + " Turkish ASCII turns to multi-byte. On some systems Turkish locale + " is available but toupper()/tolower() don't do the right thing. + try + lang tr_TR.UTF-8 + set casemap= + let iupper = toupper('i') + if iupper == "\u0130" call setline(1, 'iI') 1normal gUU call assert_equal("\u0130I", getline(1)) @@ -1645,8 +1646,7 @@ fun! Test_normal30_changecase() 1normal guu call assert_equal("i\u0131", getline(1)) call assert_equal("i\u0131", tolower("iI")) - - set casemap& + elseif iupper == "I" call setline(1, 'iI') 1normal gUU call assert_equal("II", getline(1)) @@ -1656,13 +1656,25 @@ fun! Test_normal30_changecase() 1normal guu call assert_equal("ii", getline(1)) call assert_equal("ii", tolower("iI")) + else + call assert_true(false, "expected toupper('i') to be either 'I' or '\u0130'") + endif + set casemap& + call setline(1, 'iI') + 1normal gUU + call assert_equal("II", getline(1)) + call assert_equal("II", toupper("iI")) - lang en_US.UTF-8 - catch /E197:/ - " can't use Turkish locale - throw 'Skipped: Turkish locale not available' - endtry - endif + call setline(1, 'iI') + 1normal guu + call assert_equal("ii", getline(1)) + call assert_equal("ii", tolower("iI")) + + lang en_US.UTF-8 + catch /E197:/ + " can't use Turkish locale + throw 'Skipped: Turkish locale not available' + endtry " clean up bw!