Skip to content

Commit

Permalink
Start adding tests for handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
mindofmatthew committed Jul 6, 2023
1 parent b228d70 commit 8f6e3f7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/Sound/Tidal/StreamTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ module Sound.Tidal.StreamTest where

import Test.Microspec

import Sound.Tidal.Config
import Sound.Tidal.Stream
import Sound.Tidal.Types
import qualified Sound.Osc.Fd as O
import qualified Data.Map.Strict as M
import Control.Concurrent.MVar

run :: Microspec ()
run =
main :: Microspec ()
main =
describe "Sound.Tidal.Stream" $ do
describe "toDatum" $ do
it "should convert VN to osc float" $ do
Expand All @@ -35,3 +37,9 @@ run =
getString (M.singleton "s" (VS "sn")) "s=bd" `shouldBe` Just "sn"
it "should work for missing params with fallback expressions" $ do
getString M.empty "s=bd" `shouldBe` Just "bd"

describe "handshake" $ do
it "should only handshake when a busPort is set" $ monadicIO $ do
superdirtHandshake <- run $ newMVar False
run $ startStream defaultConfig [(superdirtTarget, [superdirtShape])]
(== True) <$> run (readMVar superdirtHandshake)

0 comments on commit 8f6e3f7

Please sign in to comment.