package registry_test

import (
	"flow/internal/assert"
	"flow/registry"
	"strings"
	"testing"
)

func TestMakeBatch(t *testing.T) {
	a := assert.A(t)
	r := registry.New()

	b := registry.MakeBatch(
		r.Add(strings.Split, strings.Join),
		r.Add(strings.Compare),
		r.Register("named", strings.Compare),
	)
	a.Eq(len(b), 4, "should have 3 entries in batch")

	b.DescInputs("str")
	b.DescOutput("result")

	for _, en := range b {
		a.Eq(en.Description.Inputs[0].Name, "str", "first input should be string")
		a.Eq(en.Description.Output.Name, "result", "output should be equal")
	}

}
