-
-
Save jnthn/d5ff84151b52b188a4b681664791cf83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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