Skip to main content
Glama
emicklei

melrōse musical expression player

by emicklei
join_test.go1.42 kB
package op import ( "testing" "github.com/emicklei/melrose/core" ) func TestJoin_Storex(t *testing.T) { l := core.MustParseSequence("A B") r := core.MustParseSequence("C D") if got, want := (Join{Target: []core.Sequenceable{l, r}}).Storex(), `join(sequence('A B'),sequence('C D'))`; got != want { t.Errorf("got [%v] want [%v]", got, want) } } func TestJoin_S(t *testing.T) { l := core.MustParseSequence("A B") r := core.MustParseSequence("C D") j := Join{Target: []core.Sequenceable{l, r}} if got, want := j.S().Storex(), "sequence('A B C D')"; got != want { t.Errorf("got [%v] want [%v]", got, want) } j = Join{Target: []core.Sequenceable{}} if got, want := j.S().Storex(), "sequence('')"; got != want { t.Errorf("got [%v] want [%v]", got, want) } } func TestJoin_Sequenceables(t *testing.T) { l := core.MustParseSequence("A B") j := Join{Target: []core.Sequenceable{l}} if got, want := len(j.Sequenceables()), 1; got != want { t.Errorf("got [%v] want [%v]", got, want) } } func TestJoin_Replaced(t *testing.T) { l := core.MustParseSequence("A B") r := core.MustParseSequence("C D") j := Join{Target: []core.Sequenceable{l, r}} if core.IsIdenticalTo(j, l) { t.Error("should not be identical") } if !core.IsIdenticalTo(j.Replaced(l, r).(Join).Target[0], r) { t.Error("not replaced") } if !core.IsIdenticalTo(j.Replaced(j, r), r) { t.Error("should be replaced by r") } }

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