about summary refs log tree commit diff
path: root/Test/C05debug.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-09-05 09:05:21 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-09-05 09:05:21 +0000
commit7ce1d5735832e51bc13e255f2e8549873c9688ff (patch)
tree4118a3d83afcbbf385bc43a0dfd576849b2bb1ad /Test/C05debug.ztst
parent52f401a4a7c90e338bd70b807c05e66ce3f2b783 (diff)
downloadzsh-7ce1d5735832e51bc13e255f2e8549873c9688ff.tar.gz
zsh-7ce1d5735832e51bc13e255f2e8549873c9688ff.tar.xz
zsh-7ce1d5735832e51bc13e255f2e8549873c9688ff.zip
25615: $ZSH_DEBUG_CMD for use in DEBUG traps
Diffstat (limited to 'Test/C05debug.ztst')
-rw-r--r--Test/C05debug.ztst25
1 files changed, 25 insertions, 0 deletions
diff --git a/Test/C05debug.ztst b/Test/C05debug.ztst
index a6ef54bb4..6594eb8a1 100644
--- a/Test/C05debug.ztst
+++ b/Test/C05debug.ztst
@@ -112,3 +112,28 @@
 >    second
 >    third
 
+  fn() {
+    emulate -L zsh; setopt debugbeforecmd
+    trap 'print "$LINENO: '\''$ZSH_DEBUG_CMD'\''"' DEBUG
+    print foo &&
+    print bar ||
+    print rod
+    x=y
+    print $x
+    fn2() { echo wow }
+    fn2
+  }
+  fn
+0:ZSH_DEBUG_CMD in debug traps
+>3: 'print foo && print bar || print rod'
+>foo
+>bar
+>6: 'x=y '
+>7: 'print $x'
+>y
+>8: 'fn2 () {
+>	echo wow
+>}'
+>9: 'fn2'
+>0: 'echo wow'
+>wow