summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-02-12 22:14:53 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-12 22:39:40 +0100
commitbd1232a1faf56b614a1e74c4ce51bc6e0650ae00 (patch)
treee4037f4cfb6ccddad1a599be613fd456e33b094f /src/testdir
parentf2d90a351159fd6843f450850f52004f42e00183 (diff)
patch 9.1.0101: upper-case of German sharp s should be U+1E9Ev9.1.0101
Problem: upper-case of ß should be U+1E9E (CAPITAL LETTER SHARP S) (fenuks) Solution: Make gU, ~ and g~ convert the U+00DF LATIN SMALL LETTER SHARP S (ß) to U+1E9E LATIN CAPITAL LETTER SHARP S (ẞ), update tests (glepnir) This is part of Unicode 5.1.0 from April 2008, so should be fairly safe to use now and since 2017 is part of the German standard orthography, according to Wikipedia: https://en.wikipedia.org/wiki/Capital_%E1%BA%9E#cite_note-auto-12 There is however one exception: UnicodeData.txt for U+00DF LATIN SMALL LETTER SHARP S does NOT define U+1E9E LATIN CAPITAL LETTER SHARP S as its upper case version. Therefore, toupper() won't be able to convert from lower sharp s to upper case sharp s (the other way around however works, since U+00DF is considered the lower case character of U+1E9E and therefore tolower() works correctly for the upper case version). fixes: #5573 closes: #14018 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_normal.vim14
-rw-r--r--src/testdir/test_utf8_comparisons.vim35
-rw-r--r--src/testdir/test_visual.vim6
3 files changed, 45 insertions, 10 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index fb9c3ded53..dc68a158a1 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -2347,19 +2347,19 @@ func Test_normal30_changecase()
norm! 1ggVu
call assert_equal('this is a simple test: äüöß', getline('.'))
norm! VU
- call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖSS', getline('.'))
+ call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖẞ', getline('.'))
norm! guu
- call assert_equal('this is a simple test: äüöss', getline('.'))
+ call assert_equal('this is a simple test: äüöß', getline('.'))
norm! gUgU
- call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖSS', getline('.'))
+ call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖẞ', getline('.'))
norm! gugu
- call assert_equal('this is a simple test: äüöss', getline('.'))
+ call assert_equal('this is a simple test: äüöß', getline('.'))
norm! gUU
- call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖSS', getline('.'))
+ call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖẞ', getline('.'))
norm! 010~
- call assert_equal('this is a SIMPLE TEST: ÄÜÖSS', getline('.'))
+ call assert_equal('this is a SIMPLE TEST: ÄÜÖẞ', getline('.'))
norm! V~
- call assert_equal('THIS IS A simple test: äüöss', getline('.'))
+ call assert_equal('THIS IS A simple test: äüöß', getline('.'))
call assert_beeps('norm! c~')
%d
call assert_beeps('norm! ~')
diff --git a/src/testdir/test_utf8_comparisons.vim b/src/testdir/test_utf8_comparisons.vim
index 3431226ada..20b5762c9d 100644
--- a/src/testdir/test_utf8_comparisons.vim
+++ b/src/testdir/test_utf8_comparisons.vim
@@ -93,4 +93,39 @@ func Test_gap()
call assert_equal(["ABCD", "", "defg"], getline(1,3))
endfunc
+" test that g~, ~ and gU correclty upper-cases ß
+func Test_uppercase_sharp_ss()
+ new
+ call setline(1, repeat(['ß'], 4))
+
+ call cursor(1, 1)
+ norm! ~
+ call assert_equal('ẞ', getline(line('.')))
+ norm! ~
+ call assert_equal('ß', getline(line('.')))
+
+ call cursor(2, 1)
+ norm! g~l
+ call assert_equal('ẞ', getline(line('.')))
+ norm! g~l
+ call assert_equal('ß', getline(line('.')))
+
+ call cursor(3, 1)
+ norm! gUl
+ call assert_equal('ẞ', getline(line('.')))
+ norm! vgU
+ call assert_equal('ẞ', getline(line('.')))
+ norm! vgu
+ call assert_equal('ß', getline(line('.')))
+ norm! gul
+ call assert_equal('ß', getline(line('.')))
+
+ call cursor(4, 1)
+ norm! vgU
+ call assert_equal('ẞ', getline(line('.')))
+ norm! vgu
+ call assert_equal('ß', getline(line('.')))
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim
index f0d8edcf84..066d7ebb25 100644
--- a/src/testdir/test_visual.vim
+++ b/src/testdir/test_visual.vim
@@ -1020,9 +1020,9 @@ func Test_visual_change_case()
exe "normal Oblah di\rdoh dut\<Esc>VkUj\r"
" Uppercase part of two lines
exe "normal ddppi333\<Esc>k0i222\<Esc>fyllvjfuUk"
- call assert_equal(['the YOUTUSSEUU end', '- yOUSSTUSSEXu -',
- \ 'THE YOUTUSSEUU END', '111THE YOUTUSSEUU END', 'BLAH DI', 'DOH DUT',
- \ '222the yoUTUSSEUU END', '333THE YOUTUßeuu end'], getline(2, '$'))
+ call assert_equal(['the YOUTUẞEUU end', '- yOUẞTUẞEXu -',
+ \ 'THE YOUTUẞEUU END', '111THE YOUTUẞEUU END', 'BLAH DI', 'DOH DUT',
+ \ '222the yoUTUẞEUU END', '333THE YOUTUßeuu end'], getline(2, '$'))
bwipe!
endfunc