Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Re: Oddball output from zerrmsg()



On Jun 3,  7:12pm, Bart Schaefer wrote:
}
} Now for the strange part.  I applied a small patch to doshfunc() to
} implement the proposed behavior and ran "make check".  I got exactly
} one failure

... which then caused additional tests that would have failed, never to
be attempted ...

} and it's a false positive:
} 
} ============
} ./A07control.ztst: starting.
} *** /tmp/zsh.ztst.err.64460     Tue Jun  3 18:57:24 2014
} --- /tmp/zsh.ztst.terr.64460    Tue Jun  3 18:57:24 2014
} ***************
} *** 1 ****
} ! fn:continue:1 not in while, until, select, or repeat loop
} --- 1 ----
} ! fn:continue:1: not in while, until, select, or repeat loop
} Test ./A07control.ztst failed: error output differs from expected as shown
} above for:
}   fn() {
}     continue
}   }
}   fn
} Was testing: continue outside loop
} ./A07control.ztst: test failed.
} ============
} 
} What?  Where did the colon after the line number in the error message go?
} Why has it not been there all along?  I don't see the code path by which
} that colon would ever have been omitted, yet A07control.ztst clearly was
} not prepared for it to be there.  Any ideas?

Tracked this down.

It turns out this test has never worked, because the "continue" propagates
up through the dynamic scopes and restarts the "while true;" loop way up
in ZTST_test itself, despite the "eval" in ZTST_execchunk; so nothing ever
has a chance to look at whether the actual stderr matches the expected.

Not even an "always" block can intercept this, which is probably a bug in
the handling of "always".

So it's not that the ":" is somehow missing from the output, it's that
the expected output has been wrong all along but is simply never seen.


diff --git a/Test/A07control.ztst b/Test/A07control.ztst
index b9b89b5..397a821 100644
--- a/Test/A07control.ztst
+++ b/Test/A07control.ztst
@@ -23,12 +23,12 @@
 >start 255
 >255
 
-  fn() {
+  $ZTST_testdir/../Src/zsh -fc 'fn() {
     continue
   }
-  fn
+  fn'
 1:continue outside loop
-?fn:continue:1 not in while, until, select, or repeat loop
+?fn:continue:1: not in while, until, select, or repeat loop
 
   for outer in 0 1 2 3; do
     print outer $outer



Messages sorted by: Reverse Date, Date, Thread, Author