rework
This commit is contained in:
32 files changed
+75060
-630
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <autoopt/reactive.hpp>
|
||||
|
||||
TEST(Reactive, Simple) {
|
||||
using namespace autoopt;
|
||||
|
||||
source<int> s1(0);
|
||||
source<int> s2(0);
|
||||
source<int> s3(0);
|
||||
transform<int, int, int> t1([](int x, int y) { return x + y; }, s1,s2);
|
||||
transform<int, int, int> t2([](int x, int y) { return x + y; }, s2,s3);
|
||||
|
||||
ASSERT_EQ(t2.get(), 0);
|
||||
ASSERT_TRUE(s1.set(1));
|
||||
ASSERT_EQ(t2.get(), 1);
|
||||
s2.set(2);
|
||||
ASSERT_EQ(t2.get(), 3);
|
||||
s3.set(3);
|
||||
ASSERT_EQ(t2.get(), 6);
|
||||
}
|
||||
Reference in new issue
Block a user