packages feed

synthesizer-core-0.4.1: src/Test/Sound/Synthesizer/Causal/Analysis.hs

module Test.Sound.Synthesizer.Causal.Analysis (tests) where

import qualified Synthesizer.Causal.Analysis as AnaC
import qualified Synthesizer.Causal.Process as Causal
import qualified Synthesizer.Plain.Analysis as Ana

import Control.Arrow ((<<<), )

import qualified Data.List.Match as Match

import Test.QuickCheck (quickCheck, )

import NumericPrelude.Numeric
import NumericPrelude.Base
import Prelude ()


tests :: [(String, IO ())]
tests =
   ("deltaSigmaModulation",
      quickCheck $ \xs ->
         Match.take xs (Ana.deltaSigmaModulation xs)
         ==
         Causal.apply AnaC.deltaSigmaModulation (xs::[Rational])) :
   ("deltaSigmaModulationPositive",
      quickCheck $ \threshold xs ->
         Match.take xs (Ana.deltaSigmaModulationPositive threshold xs)
         ==
         Causal.apply
            (AnaC.deltaSigmaModulationPositive <<<
             Causal.feedConstFst threshold) (xs::[Rational])) :
   []