Subject: | labeled loop controls don't work |
`next LABEL` etc. does not work after await.
t/07await-label.t ...... Exiting eval via next at t/07await-label.t line 25.
Exiting subroutine via next at t/07await-label.t line 25.
Exiting subroutine via next at t/07await-label.t line 25.
Exiting subroutine via next at t/07await-label.t line 25.
Label not found for "next LABEL" at t/07await-label.t line 25.
t/07await-label.t ...... Dubious, test returned 255 (wstat 65280, 0xff00)
--
Paul Evans
Subject: | 07await-label.t |
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use Future;
use Future::AsyncAwait;
my $orig_cxstack_ix = Future::AsyncAwait::__cxstack_ix;
my $before;
my $after;
# next LABEL
{
async sub with_next_label
{
my $f = shift;
LABEL: do {
await $f;
next LABEL;
fail( "unreachable" );
} while(0);
}
my $f = Future->new;
my $fret = with_next_label( $f );
$f->done;
ok( $fret->get, 'next LABEL' );
}
is( Future::AsyncAwait::__cxstack_ix, $orig_cxstack_ix,
'cxstack_ix did not grow during the test' );
done_testing;