Subject: | Results in rejected Promise returned from then() handler are not given to the next then() handler |
In short, isn't the test below supposed to pass? It seems that the
results of the Promise returned from the first then() handler are not
given to the error handler in the next then().
use warnings;
use Promises;
use Test::More tests => 2;
Promises::Deferred->new->resolve("foo")->then(sub {
my $result = shift;
is($result, "foo", "resolved. foo.");
return Promises::Deferred->new->reject("bar")->promise;
}, sub { @_ })->then(sub {
@_
}, sub {
my $result = shift;
is($result, "bar", "rejected. bar."); #### failure
});