-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeasureToEnpTest.hs
More file actions
55 lines (47 loc) · 2.37 KB
/
MeasureToEnpTest.hs
File metadata and controls
55 lines (47 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- This file is part of KSQuant2.
-- Copyright (c) 2010 - 2011, Kilian Sprotte. All rights reserved.
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
module MeasureToEnpTest
where
import qualified Measure as M ( M(M), E(L) )
import MeasureToEnp (mToEnp)
import qualified Enp as E ( Elt (..), Measure(..) )
import Test.HUnit (Test(TestList), (~=?) )
import Data.Ratio ( (%) )
import qualified Lisp as L (n60, nil)
mtoenp1 :: Test
mtoenp1 = TestList
[
E.Measure (4,4) (4,60) [E.Div 4 [E.Chord 1 False L.n60 L.nil]]
~=? let leaf = M.L 1 False 0 L.n60 L.nil
in mToEnp
[(0,leaf)]
(M.M (4,4) (4,60 % 1) leaf)
,E.Measure (1,4) (4,60) [E.Div 1 [E.Chord 1 False L.n60 L.nil]]
~=? let leaf = M.L (1%4) False 0 L.n60 L.nil
in mToEnp
[(0,leaf)]
(M.M (1,4) (4,60 % 1) leaf)
-- ,Enp.Measure (2,4) [Enp.Div 1 [Enp.Chord 1 False],
-- Enp.Div 1 [Enp.Chord 1 False,Enp.Chord 1 False]]
-- ~=? mToEnp (m (2,4) (60 % 1)
-- (d (2%4) 1
-- [(l (1%4) False),
-- (d (1%4) 1 [(l (1%8) False),
-- (l (1%8) False)])]))
-- ,Enp.Measure (2,4) [Enp.Div 1 [Enp.Chord 1 False],
-- Enp.Div 1 [Enp.Chord 1 False,Enp.Chord 1 False]]
-- ~=? mToEnp (m (2,4) (60 % 1)
-- (d (2%4) 1 [(d (1%4) 1 [(l (1%4) False)]),
-- (d (1%4) 1 [(l (1%8) False),
-- (l (1%8) False)])]))
]