|
@@ -1,28 +1,11 @@
|
|
package registry_test
|
|
package registry_test
|
|
|
|
|
|
import (
|
|
import (
|
|
- "flow"
|
|
|
|
"flow/internal/assert"
|
|
"flow/internal/assert"
|
|
"flow/registry"
|
|
"flow/registry"
|
|
"testing"
|
|
"testing"
|
|
)
|
|
)
|
|
|
|
|
|
-func TestFlowFunc(t *testing.T) {
|
|
|
|
- a := assert.A(t)
|
|
|
|
- r := registry.New()
|
|
|
|
- f := flow.New()
|
|
|
|
- f.SetRegistry(r)
|
|
|
|
-
|
|
|
|
- r.Add("flowfunc", func(paramFlow *flow.Flow) int {
|
|
|
|
- a.Eq(paramFlow, f, "Flow should be equal")
|
|
|
|
- return 0
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- op, err := f.Op("flowfunc")
|
|
|
|
- a.Eq(err, nil, "should not error fetching operator")
|
|
|
|
- op.Process()
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
func TestNewEntryInvalid(t *testing.T) {
|
|
func TestNewEntryInvalid(t *testing.T) {
|
|
a := assert.A(t)
|
|
a := assert.A(t)
|
|
r := registry.New()
|
|
r := registry.New()
|