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

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

From:
Nicholas Clark via perl5-changes
Date:
August 4, 2022 06:47
Subject:
[Perl/perl5] dfbf5f: Add tests for `do { ... } while 0;` and `do {... ...
Message ID:
Perl/perl5/push/refs/heads/blead/a2b222-dfbf5f@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: dfbf5f46d1d33033c44ae80f74f875abf73e5e02
      https://github.com/Perl/perl5/commit/dfbf5f46d1d33033c44ae80f74f875abf73e5e02
  Author: Nicholas Clark <nick@ccl4.org>
  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
case.

This commit adds the missing test cases.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About