zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] E02 test failure / ztst *> issue
@ 2020-03-11 21:15 dana
  2020-03-12  2:37 ` Jun T
  0 siblings, 1 reply; 6+ messages in thread
From: dana @ 2020-03-11 21:15 UTC (permalink / raw)
  To: Zsh hackers list

When i run E02 on master, on macOS, i get an failure for the new 'preserves
tracing' test (see output below). On my machine, `which` outputs the name of
the ヌ function without quoting.

I was going to just change it like this:

  ->$'\M-c\M-\C-C\M-\C-L' () {
  +*>(ヌ|$'\M-c\M-\C-C\M-\C-L') \(\) {

But that doesn't work the way i expected — it breaks the surrounding lines.
The documentation (B01) says this about `*>`:

  # Each line of a '>' and '?' chunk may be preceded by a '*', so the line
  # starts '*>' or '*?'.  This signifies that for any line with '*' in front
  # the actual output should be pattern matched against the corresponding
  # lines in the test output.

In actuality, if *any* `>` line is preceded by `*`, *all* of them are treated
as patterns to be matched against the corresponding lines in the output. Thus,
if the surrounding lines contain pattern meta-characters (which they do), they
need to be escaped to work correctly.

I'm not sure if the documentation is wrong or if the behaviour is. It seems
like it would be helpful if it worked the way it said, but it looks like we'd
have to pass pattern-containing line numbers or something to ZTST_diff for it
to do that. idk

dana


--- /tmp/zsh.ztst.28982/ztst.out	2020-03-11 15:57:36.000000000 -0500
+++ /tmp/zsh.ztst.28982/ztst.tout	2020-03-11 15:57:36.000000000 -0500
@@ -6,7 +6,7 @@
 	# traced
 	echo inner
 }
-$'\M-c\M-\C-C\M-\C-L' () {
+ヌ () {
 	# traced
 	echo inner
 }
Test ./E02xtrace.ztst failed: output differs from expected as shown above for:
  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
Was testing: a function that redefines itself preserves tracing


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-13 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 21:15 [BUG] E02 test failure / ztst *> issue dana
2020-03-12  2:37 ` Jun T
2020-03-12 17:31   ` dana
2020-03-12 17:36     ` Peter Stephenson
2020-03-13 10:08     ` Jun T
2020-03-13 13:52       ` dana

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).