Mercurial > vim
diff src/testdir/test_farsi.vim @ 10745:265268ea1adc v8.0.0262
patch 8.0.0262: Farsi support is barely tested
commit https://github.com/vim/vim/commit/ddf662a1c86ef0b4bd0c55c5f0aa192ebd6d9a5e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 29 17:59:12 2017 +0100
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 29 Jan 2017 18:00:05 +0100 |
parents | 43b8570abbec |
children | b8a79277269a |
line wrap: on
line diff
--- 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