diff options
author | Peter Stephenson <pws@zsh.org> | 2015-12-10 17:51:41 +0000 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-12-10 17:51:41 +0000 |
commit | a5233fd01e9ab4953b7ff8b4cc031485b414b8e3 (patch) | |
tree | 504e0695345eed7a11c8c686e4436f6f7db742e8 /Test | |
parent | 67877f60552019226e93f56b108f7b61a60ea11b (diff) | |
download | zsh-a5233fd01e9ab4953b7ff8b4cc031485b414b8e3.tar.gz zsh-a5233fd01e9ab4953b7ff8b4cc031485b414b8e3.tar.xz zsh-a5233fd01e9ab4953b7ff8b4cc031485b414b8e3.zip |
37378: New bindkey tests.
Also fix Meta bug on pattern match in zpty -r.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/X03zlebindkey.ztst | 45 | ||||
-rw-r--r-- | Test/comptest | 2 |
2 files changed, 46 insertions, 1 deletions
diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst new file mode 100644 index 000000000..70c42f9c2 --- /dev/null +++ b/Test/X03zlebindkey.ztst @@ -0,0 +1,45 @@ +# Tests of the vi mode of ZLE + +%prep + mb_ok= + langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 + $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) + for LANG in $langs; do + if [[ é = ? ]]; then + ZSH_TEST_LANG=$LANG + mb_ok=1 + break; + fi + done + if [[ $OSTYPE = cygwin ]]; then + ZTST_unimplemented="the zsh/zpty module does not work on Cygwin" + elif ( zmodload zsh/zpty 2>/dev/null ); then + . $ZTST_srcdir/comptest + comptestinit -z $ZTST_testdir/../Src/zsh + else + ZTST_unimplemented="the zsh/zpty module is not available" + fi + +%test + + zpty_run 'bindkey -s "\C-xy" foo' + zletest $'\C-xy' + zpty_run 'bindkey -r "\C-xy"' +0:bindkey -s +>BUFFER: foo +>CURSOR: 3 + + if [[ -z $mb_ok ]]; then + ZTST_skip="bindkey multibyte test skipped" + else + zpty_run 'alias unbind="bindkey -r ホ"' + zpty_run 'bindkey -s ホ bar' + zletest 'ホ' + zpty_run unbind + zletest 'ホ' + fi +0:bindkey -s multibyte characters +>BUFFER: bar +>CURSOR: 3 +>BUFFER: ホ +>CURSOR: 1 diff --git a/Test/comptest b/Test/comptest index f10739abe..166d0b404 100644 --- a/Test/comptest +++ b/Test/comptest @@ -27,7 +27,7 @@ comptestinit () { } comptesteval \ -"export LC_ALL=C" \ +"export LC_ALL=${ZSH_TEST_LANG:-C}" \ "emulate -R zsh" \ "export ZDOTDIR=$ZTST_testdir" \ "module_path=( $module_path )" \ |