Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SachiSakurane committed Feb 28, 2025
1 parent d9aa989 commit fccc9c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/notify/to_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ TEST(Notify_ToObserverTest, AssignLeftValueObserver) {
auto o = b | [](auto i){ return i * 92; };
std::unique_ptr<riw::observer<int>> oo{o | riw::to_observer_unique_ptr};
ASSERT_EQ(oo->observe(), 3864);

b = 27;
ASSERT_EQ(oo->observe(), 2484);
}

TEST(Notify_ToObserverTest, AssignRightValueObserver) {
riw::behavior<int> b{42};

std::unique_ptr<riw::observer<int>> o{b | [](auto i){ return i * 92; } | riw::to_observer_unique_ptr};
ASSERT_EQ(o->observe(), 3864);

b = 27;
ASSERT_EQ(o->observe(), 2484);
}

0 comments on commit fccc9c0

Please sign in to comment.