develooper Front page | perl.perl5.changes | Postings from August 2022

[Perl/perl5] dfbf5f: Add tests for `do { ... } while 0;` and `do {... ...

Nicholas Clark via perl5-changes
August 4, 2022 06:47
[Perl/perl5] dfbf5f: Add tests for `do { ... } while 0;` and `do {... ...
Message ID:
  Branch: refs/heads/blead
  Commit: dfbf5f46d1d33033c44ae80f74f875abf73e5e02
  Author: Nicholas Clark <>
  Date:   2022-08-04 (Thu, 04 Aug 2022)

  Changed paths:
    M t/cmd/mod.t

  Log Message:
  Add tests for `do { ... } while 0;` and `do { ... } until 1;`

Astoundingly, even though we had the perl code as a comment in the C code
which handles this special case in Perl_newLOOPOP(), we didn't actually have
a regression test for it. Father C added a test case for a variant in commit
fc39925ca702f4c8 in Dec 2013, where the value for until is a constant, but
constant folding fails, but the "simple" version never actually had a test

This commit adds the missing test cases. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About