From ddf662a1c86ef0b4bd0c55c5f0aa192ebd6d9a5e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jan 2017 17:59:12 +0100 Subject: 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. --- src/testdir/test_farsi.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/testdir/test_farsi.vim') 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\", '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 ` ! @ # $ % ^ & * () - _ = + \\ | : \" . / < > ? \", '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 ; \ , [ ] \", 'tx') + call assert_equal("\x8cÌν®¥ª­«¦¹¸·¶µ´³²±°Ô\x93Õ¡ ô ú À ö æ ç Â [ ] ÷ ó ò ð õ ñ ¢ £  § ® ¤ ¥ ª ¬ è ¨© ­ é ½ « ë ê º » ¦  ¯ ¾ ¼ ¿ Ñ ù Ì Î Ï á þ Æ Ã Ü ø Á à Å ü Þ Ý Ä Ë Ë Ê É Ó Ù Ð û Ø Ö Í Í Ò Ô Ô × Õ ý Ú  ß Ç È ", getline('.')) + + bwipe! +endfunc -- cgit v1.2.3