diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-07-21 17:06:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-07-21 17:06:00 +0200 |
commit | ac7c33e38c6e47a9568c1037e9ddd09d29c2a64e (patch) | |
tree | 5227002ee87a7cac4c342c612420833536f798f4 /src/testdir | |
parent | 9ba7e17de1b9ff6f443858036ac15624d86929aa (diff) | |
download | vim-ac7c33e38c6e47a9568c1037e9ddd09d29c2a64e.zip |
updated for version 7.4a.036
Problem: "\p" in a regexp does not match double-width characters.
(Yukihiro Nakadaira)
Solution: Don't count display cells, use vim_isprintc().
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test64.in | 1 | ||||
-rw-r--r-- | src/testdir/test64.ok | 3 | ||||
-rw-r--r-- | src/testdir/test95.in | 11 | ||||
-rw-r--r-- | src/testdir/test95.ok | 7 |
4 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test64.in b/src/testdir/test64.in index ec6107fb1..a946aa450 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -228,6 +228,7 @@ STARTTEST :call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) :call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) :call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', '']) +:call add(tl, [2, '\p*', 'aá ', 'aá ']) :" :" Test greedy-ness and lazy-ness :call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok index 4203c8f39..efcf8dd50 100644 --- a/src/testdir/test64.ok +++ b/src/testdir/test64.ok @@ -506,6 +506,9 @@ OK 2 - \v(a(c*)+b)+ OK 0 - \v(a|b*)+ OK 1 - \v(a|b*)+ OK 2 - \v(a|b*)+ +OK 0 - \p* +OK 1 - \p* +OK 2 - \p* OK 0 - a\{-2,7} OK 1 - a\{-2,7} OK 2 - a\{-2,7} diff --git a/src/testdir/test95.in b/src/testdir/test95.in index 306c1b4f9..90fa69945 100644 --- a/src/testdir/test95.in +++ b/src/testdir/test95.in @@ -29,6 +29,7 @@ STARTTEST :" this is not a normal "i" but 0xec :call add(tl, [2, '\p\+', 'ìa', 'ìa']) +:call add(tl, [2, '\p*', 'aあ', 'aあ']) :"""" Test recognition of some character classes :call add(tl, [2, '\i\+', '&*¨xx ', 'xx']) @@ -118,6 +119,16 @@ STARTTEST :endfor :unlet t tl e l +:" check that 'ambiwidth' does not change the meaning of \p +:set regexpengine=1 ambiwidth=single +:$put ='eng 1 ambi single: ' . match(\"\u00EC\", '\p') +:set regexpengine=1 ambiwidth=double +:$put ='eng 1 ambi double: ' . match(\"\u00EC\", '\p') +:set regexpengine=2 ambiwidth=single +:$put ='eng 2 ambi single: ' . match(\"\u00EC\", '\p') +:set regexpengine=2 ambiwidth=double +:$put ='eng 2 ambi double: ' . match(\"\u00EC\", '\p') + :/\%#=1^Results/,$wq! test.out ENDTEST diff --git a/src/testdir/test95.ok b/src/testdir/test95.ok index b9cdd2e18..c378221a7 100644 --- a/src/testdir/test95.ok +++ b/src/testdir/test95.ok @@ -17,6 +17,9 @@ OK 2 - [ม[:alpha:][=a=]]\+ OK 0 - \p\+ OK 1 - \p\+ OK 2 - \p\+ +OK 0 - \p* +OK 1 - \p* +OK 2 - \p* OK 0 - \i\+ OK 1 - \i\+ OK 2 - \i\+ @@ -113,3 +116,7 @@ OK 2 - \Zֹ\+ OK 0 - [^[=a=]]\+ OK 1 - [^[=a=]]\+ OK 2 - [^[=a=]]\+ +eng 1 ambi single: 0 +eng 1 ambi double: 0 +eng 2 ambi single: 0 +eng 2 ambi double: 0 |