Imported from ../bash-2.05b.tar.gz.
[platform/upstream/bash.git] / tests / trap.tests
index f34e825..3e2d00d 100644 (file)
@@ -12,7 +12,7 @@ trap
 
 func()
 {
-       trap 'echo [$LINENO] funcdebug' DEBUG
+       trap 'echo ${FUNCNAME:-$0}[$LINENO] funcdebug' DEBUG
        echo funcdebug line
 }
 
@@ -25,6 +25,16 @@ func
 
 trap
 
+trap 'echo ${FUNCNAME:-$0}[$LINENO] debug' DEBUG
+func2()
+{
+       echo func2debug line
+}
+declare -ft func2
+func2
+
+unset -f func2
+
 trap '' DEBUG
 
 trap
@@ -74,4 +84,3 @@ trap -p SIGCHLD
 trap SIGINT QUIT TERM
 
 trap
-