diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-10-13 21:32:24 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-10-13 21:32:24 +0000 |
commit | ec3c5af51bfcb51f976b184af54d6b0c12b077f3 (patch) | |
tree | 62bbeddd3e75559a71fa45465439dc59493d27b1 /bin/ksh/tests/alias.t | |
parent | 647a0f92a2544a00265b0a8eaff14f417a2dbe0f (diff) |
Update to version 5.2.11.
Diffstat (limited to 'bin/ksh/tests/alias.t')
-rw-r--r-- | bin/ksh/tests/alias.t | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/bin/ksh/tests/alias.t b/bin/ksh/tests/alias.t new file mode 100644 index 00000000000..0db6a2594cd --- /dev/null +++ b/bin/ksh/tests/alias.t @@ -0,0 +1,91 @@ +name: alias-1 +description: + Check that recursion is detected/avoided in aliases. +stdin: + alias fooBar=fooBar + fooBar + exit 0 +expected-stderr-pattern: + /fooBar.*not found.*/ +--- + +name: alias-2 +description: + Check that recursion is detected/avoided in aliases. +stdin: + alias fooBar=barFoo + alias barFoo=fooBar + fooBar + barFoo + exit 0 +expected-stderr-pattern: + /fooBar.*not found.*\n.*barFoo.*not found/ +--- + +name: alias-3 +description: + Check that recursion is detected/avoided in aliases. +stdin: + alias Echo='echo ' + alias fooBar=barFoo + alias barFoo=fooBar + Echo fooBar + unalias barFoo + Echo fooBar +expected-stdout: + fooBar + barFoo +--- + +name: alias-4 +description: + Check that alias expansion isn't done on keywords (in keyword + postitions). +stdin: + alias Echo='echo ' + alias while=While + while false; do echo hi ; done + Echo while +expected-stdout: + While +--- + +name: alias-5 +description: + Check that alias expansion done after alias with trailing space. +stdin: + alias Echo='echo ' + alias foo='bar stuff ' + alias bar='Bar1 Bar2 ' + alias stuff='Stuff' + alias blah='Blah' + Echo foo blah +expected-stdout: + Bar1 Bar2 Stuff Blah +--- + +name: alias-6 +description: + Check that alias expansion done after alias with trailing space. +stdin: + alias Echo='echo ' + alias foo='bar bar' + alias bar='Bar ' + alias blah=Blah + Echo foo blah +expected-stdout: + Bar Bar Blah +--- + +name: alias-7 +description: + Check that alias expansion done after alias with trailing space + after a keyword. +stdin: + alias X='case ' + alias Y=Z + X Y in 'Y') echo is y ;; Z) echo is z ; esac +expected-stdout: + is z +--- + |