Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / tests / type.tests
index 706e3be..1c03e01 100644 (file)
@@ -19,7 +19,6 @@ func() { echo this is func; }
 
 type -t func
 type -t while
-type -t m
 type -t builtin
 type -t /bin/sh
 type -t ${THIS_SH}
@@ -29,7 +28,6 @@ type func
 # the following two should produce identical output
 type while
 type -a while
-type m
 type builtin
 type /bin/sh
 
@@ -37,11 +35,27 @@ command -v func
 command -V func
 command -v while
 command -V while
-# the following three lines should produce the same output
+
+# the following two lines should produce the same output
+# post-3.0 patch makes command -v silent, as posix specifies
+# first test with alias expansion off (should all fail or produce no output)
+type -t m
+type m
 command -v m
 alias -p
 alias m
+
+# then test with alias expansion on 
+shopt -s expand_aliases
+type m
+type -t m
+command -v m
+alias -p
+alias m
+
 command -V m
+shopt -u expand_aliases
+
 command -v builtin
 command -V builtin
 command -v /bin/sh
@@ -66,3 +80,18 @@ type -t $SHBASE
 
 # make sure the hash table looks right
 hash
+
+# bug in versions of bash up to and including bash-3.2
+f() {
+        v=$'\001'
+    }
+
+type f | cat -v
+
+${THIS_SH} type1.sub
+
+${THIS_SH} type2.sub
+
+${THIS_SH} type3.sub
+
+${THIS_SH} type4.sub