mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 17:20:25 +02:00
26545: new "emulate" test
This commit is contained in:
parent
7b31a15de8
commit
51a646917a
2 changed files with 79 additions and 1 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
2009-02-10 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 26545: Test/B07emulate.ztst: new test.
|
||||||
|
|
||||||
2009-02-10 Clint Adams <clint@zsh.org>
|
2009-02-10 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
* 26544: Completion/Unix/Command/_lp: complete pdf files
|
* 26544: Completion/Unix/Command/_lp: complete pdf files
|
||||||
|
|
@ -11124,5 +11128,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||||
* $Revision: 1.4557 $
|
* $Revision: 1.4558 $
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
|
||||||
74
Test/B07emulate.ztst
Normal file
74
Test/B07emulate.ztst
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
# Test the "emulate" builtin and related functions.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
|
||||||
|
isset() {
|
||||||
|
if [[ -o $1 ]]; then print yes; else print no; fi
|
||||||
|
}
|
||||||
|
showopts() {
|
||||||
|
# Set for Bourne shell emulation
|
||||||
|
isset shwordsplit
|
||||||
|
# Set in native mode and unless "emulate -R" is in use
|
||||||
|
isset banghist
|
||||||
|
}
|
||||||
|
|
||||||
|
%test
|
||||||
|
|
||||||
|
(showopts
|
||||||
|
fn() {
|
||||||
|
emulate sh
|
||||||
|
}
|
||||||
|
fn
|
||||||
|
showopts)
|
||||||
|
0:Basic use of emulate
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
|
||||||
|
fn() {
|
||||||
|
emulate -L sh
|
||||||
|
showopts
|
||||||
|
}
|
||||||
|
showopts
|
||||||
|
fn
|
||||||
|
showopts
|
||||||
|
0:Use of emulate -L
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
|
||||||
|
(showopts
|
||||||
|
emulate -R sh
|
||||||
|
showopts)
|
||||||
|
0:Use of emulate -R
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>no
|
||||||
|
|
||||||
|
showopts
|
||||||
|
emulate sh -c 'showopts'
|
||||||
|
showopts
|
||||||
|
0:Use of emulate -c
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
|
||||||
|
|
||||||
|
showopts
|
||||||
|
emulate -R sh -c 'showopts'
|
||||||
|
showopts
|
||||||
|
0:Use of emulate -R -c
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
|
>yes
|
||||||
|
>no
|
||||||
|
>no
|
||||||
|
>yes
|
||||||
Loading…
Add table
Add a link
Reference in a new issue