Skip to main content
Glama
emicklei

melrōse musical expression player

by emicklei
interfaces_test.go1.5 kB
package dsl import ( "testing" "github.com/emicklei/melrose/control" "github.com/emicklei/melrose/core" "github.com/emicklei/melrose/op" ) func TestImplements(t *testing.T) { for _, each := range []struct { source any notSequenceable bool notStorable bool }{ {source: core.Note{}}, {source: core.Chord{}}, {source: core.Scale{}}, {source: core.ChordSequence{}}, {source: core.ChordProgression{}}, {source: new(core.MultiTrack), notSequenceable: true}, } { if !each.notSequenceable { if _, ok := each.source.(core.Sequenceable); !ok { t.Errorf("%T does not implement Sequenceable", each.source) } } if !each.notStorable { if _, ok := each.source.(core.Storable); !ok { t.Errorf("%T does not implement Storable", each.source) } } } } func TestImplementsPlayable(t *testing.T) { for _, each := range []struct { source any notSequenceable bool notStorable bool }{ {source: new(core.Loop)}, {source: new(control.Listen)}, } { if !each.notSequenceable { if _, ok := each.source.(core.Playable); !ok { t.Errorf("%T does not implement Playable", each.source) } } } } func TestImplementsReplaceable(t *testing.T) { for _, each := range []struct { source any }{ {source: op.Repeat{}}, {source: op.Fraction{}}, {source: op.Serial{}}, {source: op.Reverse{}}, } { if _, ok := each.source.(core.Replaceable); !ok { t.Errorf("%T does not implement Replaceable", each.source) } } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/emicklei/melrose'

If you have feedback or need assistance with the MCP directory API, please join our Discord server