Beispiel #1
0
TEST(Promise, isFulfilled) {
    Promise<int> p;

    EXPECT_FALSE(p.isFulfilled());
    p.setValue(42);
    EXPECT_TRUE(p.isFulfilled());
}
Beispiel #2
0
TEST(Promise, isFulfilledWithFuture) {
    Promise<int> p;
    auto f = p.getFuture(); // so core_ will become null

    EXPECT_FALSE(p.isFulfilled());
    p.setValue(42); // after here
    EXPECT_TRUE(p.isFulfilled());
}