Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/bug.p6 Secret

Created November 23, 2016 18:58
use Test;
# RT #128991
lives-ok {
for ^5 {
my $p = Promise.new;
my $s = supply {
whenever Supply.interval(.001) {
done if $++ > 50;
}
}
$s.tap(done => { $p.keep(True) }); # Will die if keeping twice
await $p;
}
}, 'Never get done message twice from a supply';
lives-ok {
for ^5 {
react {
whenever Supply.interval(.001) {
done if $++ > 50;
}
}
}
}, 'No react guts crash in case that once spat out two done messages either';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment