package cli

import (
	"context"
	"iop/apps/node/internal/runtime"
)

type testSink struct {
	events []runtime.RuntimeEvent
}

func (s *testSink) Emit(_ context.Context, e runtime.RuntimeEvent) error {
	s.events = append(s.events, e)
	return nil
}

type mockLineEmitter struct {
	name   string
	emitFn func(line string) ([]runtime.RuntimeEvent, error)
}

func (m *mockLineEmitter) Name() string { return m.name }

func (m *mockLineEmitter) Emit(line string) ([]runtime.RuntimeEvent, error) {
	if m.emitFn != nil {
		return m.emitFn(line)
	}
	return nil, nil
}
