Files
start-os/agent/test/Lib/SoundSpec.hs
Aiden McClelland 95d3845906 0.2.5 initial commit
Makefile incomplete
2020-11-23 13:44:28 -07:00

17 lines
496 B
Haskell

module Lib.SoundSpec where
import Startlude
import Test.Hspec
import Lib.Sound
spec :: Spec
spec = describe "Sound Interface" $ do
it "Async sound actions should be FIFO" $ do
action <- async $ playSongTimed 400 marioDeath
action' <- async $ playSongTimed 400 marioDeath
marks0 <- wait action
marks1 <- wait action'
(marks0, marks1) `shouldSatisfy` \((s0, f0), (s1, f1)) -> s1 > s0 && s1 > f0 || s0 > s1 && s0 > f1