]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/alias.tests
bash-5.2 distribution sources and documentation
[thirdparty/bash.git] / tests / alias.tests
CommitLineData
8868edaf
CR
1# This program is free software: you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation, either version 3 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <http://www.gnu.org/licenses/>.
13#
b80f6443
JA
14# place holder for future alias testing
15shopt -s expand_aliases
16
17# alias/unalias tests originally in builtins.tests
18
19unalias -a
20# this should return success, according to POSIX.2
21alias
22echo alias: $?
23alias foo=bar
24unalias foo
25# this had better return success, according to POSIX.2
26alias
27echo alias: $?
28
29# bug in all versions through bash-2.05b
30
31unalias qfoo qbar qbaz quux 2>/dev/null
32
33alias qfoo=qbar
34alias qbar=qbaz
35alias qbaz=quux
36alias quux=qfoo
37
38qfoo
39
40unalias qfoo qbar qbaz quux
41
42unalias -a
43
44alias foo='echo '
45alias bar=baz
46alias baz=quux
47
48foo bar
49
50unalias foo bar baz
0001803f 51
74091dd4
CR
52# post bash-5.1 problems with compound array assignment during multiline
53# alias expansion
54alias foo='a=() b=""
55for i in 1; do echo hi; done'
56foo
57
58unalias foo
59
0001803f 60${THIS_SH} ./alias1.sub
a0c0a00f 61${THIS_SH} ./alias2.sub
d233b485
CR
62${THIS_SH} ./alias3.sub
63${THIS_SH} ./alias4.sub
8868edaf 64${THIS_SH} ./alias5.sub
74091dd4 65${THIS_SH} ./alias6.sub