summaryrefslogtreecommitdiff
path: root/src/testdir/test_farsi.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-29 17:59:12 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-29 17:59:12 +0100
commitddf662a1c86ef0b4bd0c55c5f0aa192ebd6d9a5e (patch)
tree70e917e0c60dffd51b2a037c039a8fd5d3bfa3b5 /src/testdir/test_farsi.vim
parent24c2e48ef8b8b9053fa18039e6f6118337f908f8 (diff)
downloadvim-ddf662a1c86ef0b4bd0c55c5f0aa192ebd6d9a5e.zip
patch 8.0.0262: Farsi support is barely tested
Problem: Farsi support is barely tested. Solution: Add more tests for Farsi. Clean up the code.
Diffstat (limited to 'src/testdir/test_farsi.vim')
-rw-r--r--src/testdir/test_farsi.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_farsi.vim b/src/testdir/test_farsi.vim
index 81afce27f..9c165d7fb 100644
--- a/src/testdir/test_farsi.vim
+++ b/src/testdir/test_farsi.vim
@@ -1,4 +1,5 @@
" Simplistic testing of Farsi mode.
+" Note: must be edited with latin1 encoding.
if !has('farsi')
finish
@@ -82,3 +83,21 @@ func Test_farsi_map()
set noaltkeymap
bwipe!
endfunc
+
+func Test_input_farsi()
+ new
+ setlocal rightleft fkmap
+ " numbers switch input direction
+ call feedkeys("aabc0123456789.+-^%#=xyz\<Esc>", 'tx')
+ call assert_equal("\x8cÌν®¥ª­«¦¹¸·¶µ´³²±°Ô\x93Õ", getline('.'))
+
+ " all non-number special chars
+ call feedkeys("aB E F H I K L M O P Q R T U W Y ` ! @ # $ % ^ & * () - _ = + \\ | : \" . / < > ? \<Esc>", 'tx')
+ call assert_equal("\x8cÌν®¥ª­«¦¹¸·¶µ´³²±°Ô\x93Õ¡ ô ú À ö æ ç Â [ ] ÷ ó ò ð õ ñ ¢ £  § ® ¤ ¥ ª ¬ è ¨© ­ é ½ « ë ê º » ¦  ¯ ¾ ¼ ¿ ", getline('.'))
+
+ " all letter chars
+ call feedkeys("aa A b c C d D e f g G h i j J k l m n N o p q r s S t u v V w x X y z Z ; \ , [ ] \<Esc>", 'tx')
+ call assert_equal("\x8cÌν®¥ª­«¦¹¸·¶µ´³²±°Ô\x93Õ¡ ô ú À ö æ ç Â [ ] ÷ ó ò ð õ ñ ¢ £  § ® ¤ ¥ ª ¬ è ¨© ­ é ½ « ë ê º » ¦  ¯ ¾ ¼ ¿ Ñ ù Ì Î Ï á þ Æ Ã Ü ø Á à Å ü Þ Ý Ä Ë Ë Ê É Ó Ù Ð û Ø Ö Í Í Ò Ô Ô × Õ ý Ú  ß Ç È ", getline('.'))
+
+ bwipe!
+endfunc