summaryrefslogtreecommitdiff
path: root/Rx/v2/test
diff options
context:
space:
mode:
authorGrigoriy Chudnov <g.chudnov@gmail.com>2017-01-16 20:30:12 +0300
committerKirk Shoop <kirk.shoop@microsoft.com>2017-01-16 09:30:12 -0800
commit6a35d221de3054885b69f1c82a78c99c83a8f47a (patch)
tree371a3c42d09066494a4e96b78e1cbd6fffd16a65 /Rx/v2/test
parent7923baae257f7036eea164d30055756e88cea498 (diff)
downloadRxCpp-6a35d221de3054885b69f1c82a78c99c83a8f47a.tar.gz
decouple switch_if_empty, default_if_empty from observable (#329)
* decouple switch_if_empty, default_if_empty from observable * decouple switch_if_empty, default_if_empty from observable - fix compile errors * decouple switch_if_empty, default_if_empty from observable - fix ref * decouple switch_if_empty, default_if_empty from observable - fix msvc2013
Diffstat (limited to 'Rx/v2/test')
-rw-r--r--Rx/v2/test/operators/default_if_empty.cpp21
-rw-r--r--Rx/v2/test/operators/switch_if_empty.cpp26
2 files changed, 38 insertions, 9 deletions
diff --git a/Rx/v2/test/operators/default_if_empty.cpp b/Rx/v2/test/operators/default_if_empty.cpp
index 048c8d5..3acd73a 100644
--- a/Rx/v2/test/operators/default_if_empty.cpp
+++ b/Rx/v2/test/operators/default_if_empty.cpp
@@ -1,4 +1,5 @@
#include "../test.h"
+#include <rxcpp/operators/rx-switch_if_empty.hpp>
SCENARIO("default_if_empty should not switch if the source is not empty", "[default_if_empty][operators]"){
GIVEN("a source"){
@@ -15,7 +16,10 @@ SCENARIO("default_if_empty should not switch if the source is not empty", "[defa
auto res = w.start(
[xs]() {
- return xs.default_if_empty(2);
+ return xs
+ | rxo::default_if_empty(2)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ | rxo::as_dynamic();
}
);
@@ -54,7 +58,10 @@ SCENARIO("default_if_empty should switch if the source is empty", "[default_if_e
auto res = w.start(
[xs]() {
- return xs.default_if_empty(2);
+ return xs
+ .default_if_empty(2)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);
@@ -92,7 +99,10 @@ SCENARIO("default_if_empty - never", "[default_if_empty][operators]"){
auto res = w.start(
[xs]() {
- return xs.default_if_empty(2);
+ return xs
+ .default_if_empty(2)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);
@@ -130,7 +140,10 @@ SCENARIO("default_if_empty - source throws", "[default_if_empty][operators]"){
auto res = w.start(
[xs]() {
- return xs.default_if_empty(2);
+ return xs
+ .default_if_empty(2)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);
diff --git a/Rx/v2/test/operators/switch_if_empty.cpp b/Rx/v2/test/operators/switch_if_empty.cpp
index 779087e..b205858 100644
--- a/Rx/v2/test/operators/switch_if_empty.cpp
+++ b/Rx/v2/test/operators/switch_if_empty.cpp
@@ -1,4 +1,5 @@
#include "../test.h"
+#include <rxcpp/operators/rx-switch_if_empty.hpp>
SCENARIO("switch_if_empty should not switch if the source is not empty", "[switch_if_empty][operators]"){
GIVEN("a source"){
@@ -20,7 +21,10 @@ SCENARIO("switch_if_empty should not switch if the source is not empty", "[switc
auto res = w.start(
[xs, ys]() {
- return xs.switch_if_empty(ys);
+ return xs
+ | rxo::switch_if_empty(ys)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ | rxo::as_dynamic();
}
);
@@ -70,7 +74,10 @@ SCENARIO("switch_if_empty should switch if the source is empty", "[switch_if_emp
auto res = w.start(
[xs, ys]() {
- return xs.switch_if_empty(ys);
+ return xs
+ .switch_if_empty(ys)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);
@@ -121,7 +128,10 @@ SCENARIO("switch_if_empty - never", "[switch_if_empty][operators]"){
auto res = w.start(
[xs, ys]() {
- return xs.switch_if_empty(ys);
+ return xs
+ .switch_if_empty(ys)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);
@@ -170,7 +180,10 @@ SCENARIO("switch_if_empty - source throws", "[switch_if_empty][operators]"){
auto res = w.start(
[xs, ys]() {
- return xs.switch_if_empty(ys);
+ return xs
+ .switch_if_empty(ys)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);
@@ -220,7 +233,10 @@ SCENARIO("switch_if_empty - backup source throws", "[switch_if_empty][operators]
auto res = w.start(
[xs, ys]() {
- return xs.switch_if_empty(ys);
+ return xs
+ .switch_if_empty(ys)
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();
}
);