Files
alda-mirror/client/parser/cram_test.go
Dave Yarwood 3d86b5d6c4 CRAM => cram
2020-04-25 16:18:16 -04:00

46 lines
1.1 KiB
Go

package parser
import (
"testing"
"alda.io/client/model"
_ "alda.io/client/testing"
)
func TestCram(t *testing.T) {
executeParseTestCases(
t,
parseTestCase{
label: "cram expression",
given: "{c d e}",
expect: []model.ScoreUpdate{
model.Cram{
Events: []model.ScoreUpdate{
model.Note{Pitch: model.LetterAndAccidentals{NoteLetter: model.C}},
model.Note{Pitch: model.LetterAndAccidentals{NoteLetter: model.D}},
model.Note{Pitch: model.LetterAndAccidentals{NoteLetter: model.E}},
},
},
},
},
parseTestCase{
label: "cram expression with specified duration",
given: "{c d e}2",
expect: []model.ScoreUpdate{
model.Cram{
Events: []model.ScoreUpdate{
model.Note{Pitch: model.LetterAndAccidentals{NoteLetter: model.C}},
model.Note{Pitch: model.LetterAndAccidentals{NoteLetter: model.D}},
model.Note{Pitch: model.LetterAndAccidentals{NoteLetter: model.E}},
},
Duration: model.Duration{
Components: []model.DurationComponent{
model.NoteLength{Denominator: 2},
},
},
},
},
},
)
}