Skip to main content
Glama
emicklei

melrōse musical expression player

by emicklei
iterator_test.go897 B
package core import ( "testing" "github.com/expr-lang/expr" ) func TestIterator_Value(t *testing.T) { var l = []any{"C", "D"} i := &Iterator{Target: l} if got, want := i.Value(), "C"; got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } i.Next() if got, want := i.Value(), "D"; got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } if got, want := i.Index().Value(), 2; got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } i.Next() if got, want := i.Value(), "C"; got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } } type loop struct { t *testing.T } func (l *loop) Index() number { l.t.Log("Index call") return 1 } type number int func TestIndex(t *testing.T) { env := map[string]any{ "a": &loop{t: t}, } _, err := expr.Compile(`a.Index()`, expr.Env(env)) t.Log(err) }

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