Skip to main content
Glama
emicklei

melrōse musical expression player

by emicklei
random_test.go929 B
package op import ( "testing" "github.com/emicklei/melrose/core" ) func TestRandomInteger_Next(t *testing.T) { r := NewRandomInteger(core.On(1), core.On(100000)) i1 := r.Next() if got, want := r.Value(), i1; got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } if got, want := r.Value(), i1; got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } r.Next() if got, want := r.Value(), i1; got == want { t.Errorf("got [%v:%T] do not want [%v:%T]", got, got, want, want) } } func TestRandomInteger_Storex(t *testing.T) { r := NewRandomInteger(core.On(1), core.On(10)) if got, want := r.Storex(), "random(1,10)"; got != want { t.Errorf("got [%v] want [%v]", got, want) } } func TestRandomInteger_Next_Error(t *testing.T) { r := NewRandomInteger(core.On(10), core.On(1)) if got, want := r.Next(), 10; got != want { t.Errorf("got [%v] want [%v]", got, want) } }

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