summaryrefslogtreecommitdiff
path: root/Rx/v2/test/operators/switch_if_empty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Rx/v2/test/operators/switch_if_empty.cpp')
-rw-r--r--Rx/v2/test/operators/switch_if_empty.cpp26
1 files changed, 21 insertions, 5 deletions
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();
}
);