-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathmode_test.go
45 lines (38 loc) · 1019 Bytes
/
mode_test.go
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
// A scale, in music, is any harmonic set of three or more notes that is heard as if sounding simultaneously.
package scale
import (
"testing"
"gopkg.in/music-theory.v0/note"
"gopkg.in/stretchr/testify.v1/assert"
)
func TestListAllModes(t *testing.T) {
assert.Equal(t, len(modes), len(ScaleModeList))
}
func TestModeMatchString(t *testing.T) {
// TODO
}
func TestScaleParseModes(t *testing.T) {
c := Of("CM")
assert.Equal(t, map[Interval]note.Class{
I1: note.C,
I2: note.D,
I3: note.E,
I4: note.F,
I5: note.G,
I6: note.A,
I7: note.B,
}, c.Tones)
}
//
// Private
//
//func assertEquivalentModes(t *testing.T, expectModes []Mode, actualModes []Mode) {
// for _, expectMode := range expectModes {
// assert.Contains(t, actualModes, expectMode,
// fmt.Sprintf("expect %v in actual %v", expectModes, actualModes))
// }
// for _, actualMode := range actualModes {
// assert.Contains(t, expectModes, actualMode,
// fmt.Sprintf("actual %v in expected %v", actualModes, expectModes))
// }
//}