module QCScale (qcScaleTests) where import Test.QuickCheck.Batch import Test.QuickCheck import Music.Diatonic import Music.Diatonic.Scale import QCNote instance Arbitrary Scale where arbitrary = do s <- elements [majorScale, minorScale, majorPentatonicScale, minorPentatonicScale, minorHarmonicScale] n <- arbitrary return (s n) coarbitrary = error "Not implemented" prop_scale_tonic s = tonic (s :: Scale) == (head . notes $ s) prop_scale_degree s = degree (tonic (s :: Scale)) (head . notes $ s) == First prop_scale_find s = dominant s == (Just $ Fifth `from` (tonic (s :: Scale))) options = TestOptions { no_of_tests = 200, length_of_tests = 0, debug_tests = False } qcScaleTests = do runTests "Music.Diatonic.Scale" options [ run prop_scale_tonic , run prop_scale_degree , run prop_scale_find ]