diff options
| author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2017-07-02 20:29:00 +0100 |
|---|---|---|
| committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2017-07-02 20:29:00 +0100 |
| commit | e8edd42f7ff0fefbf74db7fbab2d242852b6bce6 (patch) | |
| tree | 1fd467c6bb1e40164710222aed9fddde25f29aac /Test | |
| parent | 41368: Add missing unqueue_signals() to compctl. (diff) | |
| download | zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.tar zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.tar.gz zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.tar.bz2 zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.tar.lz zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.tar.xz zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.tar.zst zsh-e8edd42f7ff0fefbf74db7fbab2d242852b6bce6.zip | |
22760: fix partial string length reports with NO_MULTIBYTE
Diffstat (limited to 'Test')
| -rw-r--r-- | Test/D04parameter.ztst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index d5798b5b9..3c93990f1 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -783,16 +783,36 @@ 0:${(R)...} >is the , + # Although there's no reliance on multibyte here, the + # code exercised is different, so test both paths in the following group. + # If the shell isn't multibyte capable the tests are the same; + # that's not a problem. # This (1) doesn't work with // or / # (2) perhaps ought to be 18, to be consistent with normal zsh # substring indexing and with backreferences. print ${(BES)string##white} + (unsetopt multibyte; print ${(BES)string##white}) 0:${(BE...)...} >14 19 +>14 19 print ${(NS)string##white} + (unsetopt multibyte; print ${(NS)string##white}) 0:${(N)...} >5 +>5 + + fn() { + emulate -L zsh + local a=abcdef + print ${(SNBE)a#abcd} + unsetopt multibyte + print ${(SNBE)a#abcd} + } + fn +0:${(BEN)...} again, with match +>1 5 4 +>1 5 4 string='abcdefghijklmnopqrstuvwxyz' print ${${string%[aeiou]*}/(#m)?(#e)/${(U)MATCH}} |
