Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/bug.p6 Secret

Created November 23, 2016 18:58
Show Gist options
  • Save jnthn/d5ff84151b52b188a4b681664791cf83 to your computer and use it in GitHub Desktop.
Save jnthn/d5ff84151b52b188a4b681664791cf83 to your computer and use it in GitHub Desktop.
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