From d9dd1b63e510057d16123a6deb4e4782884883d7 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 22 Dec 2019 06:53:58 +0000 Subject: unposted (follow-up to 45131): Extra testing by Mikael --- Test/E02xtrace.ztst | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'Test') diff --git a/Test/E02xtrace.ztst b/Test/E02xtrace.ztst index 8d2c300cf..a5a7bc55c 100644 --- a/Test/E02xtrace.ztst +++ b/Test/E02xtrace.ztst @@ -147,11 +147,36 @@ ?+(anon):0> true ?+fn:0> gn - f() { - f() { echo inner } - } - functions -T f - f - which f | grep '# traced' + test_cases=( + f # baseline + foo-bar # Dash + ヌ # Meta (the UTF-8 representation of this character has an 0x83 byte) + \$\'ba\\0z\' # Nul, escaped as though by ${(qqqq)} + ) + for 1 in "$test_cases[@]"; do + eval " + ${1}() { + ${1}() { echo inner } + } + functions -T ${1} + ${1} + which ${1} + " + done 0:a function that redefines itself preserves tracing +>f () { +> # traced +> echo inner +>} +>foo-bar () { +> # traced +> echo inner +>} +>$'\M-c\M-\C-C\M-\C-L' () { +> # traced +> echo inner +>} +>$'ba\C-@z' () { > # traced +> echo inner +>} -- cgit 1.4.1