aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2017-04-15 15:06:50 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-15 15:06:50 +0200
commitc70ab1a2e2d78832e0246bd64c53c8b92912f0ef (patch)
tree36d551b0446076c8194d2c5776fd9f21645650fa /src
parent12fc1defd6a1b13d1f801173e0b6a1cef28527ae (diff)
downloadrneovim-c70ab1a2e2d78832e0246bd64c53c8b92912f0ef.tar.gz
rneovim-c70ab1a2e2d78832e0246bd64c53c8b92912f0ef.tar.bz2
rneovim-c70ab1a2e2d78832e0246bd64c53c8b92912f0ef.zip
test: make locale dependent oldtest more reliable (#6526)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_normal.vim42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index c529971528..6261625801 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -1606,12 +1606,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))
@@ -1621,8 +1622,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))
@@ -1632,13 +1632,25 @@ fun! Test_normal30_changecase()
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
- endif
+ else
+ call assert_true(false, "expected toupper('i') to be either 'I' or '\u0131'")
+ endif
+ set casemap&
+ call setline(1, 'iI')
+ 1normal gUU
+ call assert_equal("II", getline(1))
+ call assert_equal("II", toupper("iI"))
+
+ 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!