From aa4d4b5ba47c6923b833d9a9fc3af8074c80318b Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Sat, 19 Aug 2017 13:41:22 -0500 Subject: [PATCH] Add test for rxquery.Zip --- paket.lock | 2 +- .../FSharp.Control.Reactive.fsproj | 6 +++--- tests/App.config | 2 +- tests/FSharp.Control.Reactive.Tests.fsproj | 6 +++--- tests/ObservableSpecs.fs | 17 +++++++++++++++++ 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/paket.lock b/paket.lock index 0fb2eb2..4fffb53 100644 --- a/paket.lock +++ b/paket.lock @@ -1,5 +1,5 @@ REDIRECTS: ON -FRAMEWORK: NET45, NET46 +RESTRICTION: || (== net45) (== net46) NUGET remote: http://www.nuget.org/api/v2 FAKE (4.37.2) diff --git a/src/FSharp.Control.Reactive/FSharp.Control.Reactive.fsproj b/src/FSharp.Control.Reactive/FSharp.Control.Reactive.fsproj index c0c53f7..2397a81 100644 --- a/src/FSharp.Control.Reactive/FSharp.Control.Reactive.fsproj +++ b/src/FSharp.Control.Reactive/FSharp.Control.Reactive.fsproj @@ -144,14 +144,14 @@ + + True + ..\..\packages\System.Reactive.Windows.Threading\lib\net45\System.Reactive.Windows.Threading.dll True True - - True - diff --git a/tests/App.config b/tests/App.config index 36a72c5..855b22e 100644 --- a/tests/App.config +++ b/tests/App.config @@ -8,6 +8,6 @@ True - + diff --git a/tests/FSharp.Control.Reactive.Tests.fsproj b/tests/FSharp.Control.Reactive.Tests.fsproj index 8071bce..e297a30 100644 --- a/tests/FSharp.Control.Reactive.Tests.fsproj +++ b/tests/FSharp.Control.Reactive.Tests.fsproj @@ -192,14 +192,14 @@ + + True + ..\packages\System.Reactive.Windows.Threading\lib\net45\System.Reactive.Windows.Threading.dll True True - - True - diff --git a/tests/ObservableSpecs.fs b/tests/ObservableSpecs.fs index dfeeee1..8f28e2e 100644 --- a/tests/ObservableSpecs.fs +++ b/tests/ObservableSpecs.fs @@ -95,6 +95,23 @@ let ``When zip is defined with the applicative, it should match the result of Ob Assert.That(!actual, Is.EqualTo (!expected)) +[] +let ``zip used in rxquery matches output from Observable.zip`` () = + let a = Observable.ofSeq [1;2;3] + let b = Observable.ofSeq [1;2;3] + + let expected = ResizeArray() + (Observable.zip a b).Subscribe(expected.Add) |> ignore + + let actual = ResizeArray() + (rxquery { + for x in a do + zip y in b + yield x, y + }).Subscribe(actual.Add) |> ignore + + Assert.That(List.ofSeq actual = List.ofSeq expected) + [] let ``Test should show the stack overflow is fixed with Rx 2 beta``() = let test() =