diff src/testdir/test_spell.vim @ 33039:21f2838a4dd9 v9.0.1810

patch 9.0.1810: camel-case spelling has issues with digits Commit: https://github.com/vim/vim/commit/d08745040bb82c5e9a81b6c8a414e50951642492 Author: LemonBoy <thatlemon@gmail.com> Date: Sun Aug 27 21:52:27 2023 +0200 patch 9.0.1810: camel-case spelling has issues with digits Problem: camel-case spelling has issues with digits Solution: Improve the camCase spell checking by taking digits and caps into account Rewrite the conditions to check for word boundaries by taking into account the presence of digits and all-caps sequences such as acronyms. closes: #12644 closes: #12933 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: LemonBoy <thatlemon@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 22:00:06 +0200
parents 7328cddca686
children 15593f77c5c2
line wrap: on
line diff
--- a/src/testdir/test_spell.vim
+++ b/src/testdir/test_spell.vim
@@ -132,6 +132,26 @@ foobar/?
   set spell&
 endfunc
 
+func Test_spell_camelcase()
+  set spell spelloptions=camel
+  let words = [
+      \ 'UPPER',
+      \ 'lower',
+      \ 'mixedCase',
+      \ 'HTML',
+      \ 'XMLHttpRequest',
+      \ 'foo123bar',
+      \ '12345678',
+      \ 'HELLO123world',
+      \]
+
+  for word in words
+    call assert_equal(['', ''],  spellbadword(word))
+  endfor
+
+  set spell& spelloptions&
+endfunc
+
 func Test_spell_file_missing()
   let s:spell_file_missing = 0
   augroup TestSpellFileMissing