module QCKey (qcKeyTests) where import Test.QuickCheck.Batch import Test.QuickCheck import Music.Diatonic import Music.Diatonic.Scale import Music.Diatonic.Key import QCNote import QCScale instance Arbitrary Key where arbitrary = do s <- arbitrary return (key s) coarbitrary = error "Not implemented" prop_key_center k = center k == (tonic . scale $ k) prop_key_relative k = k == (relative . relative $ k) prop_key_signature k = (notes . signature $ k) == (notes . signature . relative $ k) prop_key_show_read k = (read . show $ k :: Key) == k options = TestOptions { no_of_tests = 100, length_of_tests = 0, debug_tests = False } qcKeyTests = do runTests "Music.Diatonic.Key" options [ run prop_key_center , run prop_key_relative , run prop_key_signature , run prop_key_show_read ]