summaryrefslogtreecommitdiff
path: root/internal/ior_mode_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-24 08:45:38 +0200
committerPaul Buetow <paul@buetow.org>2026-02-24 08:45:38 +0200
commite5116514c33b2fce6ce2fc7904d6720c5236221f (patch)
treee5bc8c9ba37836305ec1d095573535fb8344cbe7 /internal/ior_mode_test.go
parentb01e24374398eb3d343e9472f3262668039db56c (diff)
tui: wire eventloop stats engine into dashboard snapshots
Diffstat (limited to 'internal/ior_mode_test.go')
-rw-r--r--internal/ior_mode_test.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/internal/ior_mode_test.go b/internal/ior_mode_test.go
index ddc915b..84ff651 100644
--- a/internal/ior_mode_test.go
+++ b/internal/ior_mode_test.go
@@ -76,7 +76,10 @@ func TestDispatchRunUsesTUIStarterWhenNotPlain(t *testing.T) {
}()
traceDone := make(chan struct{}, 1)
- runTraceWithContextFn = func(_ context.Context, started chan<- struct{}) error {
+ runTraceWithContextFn = func(_ context.Context, started chan<- struct{}, configure func(*eventLoop)) error {
+ if configure != nil {
+ configure(&eventLoop{})
+ }
close(started)
traceDone <- struct{}{}
return nil
@@ -110,9 +113,9 @@ func TestDispatchRunUsesTUIStarterWhenNotPlain(t *testing.T) {
}
func TestTuiTraceStarterFromRunTracePropagatesError(t *testing.T) {
- starter := tuiTraceStarterFromRunTrace(func(context.Context, chan<- struct{}) error {
- return errors.New("startup failed")
- })
+ starter := tuiTraceStarterFromRunTrace(
+ func(context.Context, chan<- struct{}, func(*eventLoop)) error { return errors.New("startup failed") },
+ )
err := starter(context.Background())
if err == nil || err.Error() != "startup failed" {
@@ -121,10 +124,12 @@ func TestTuiTraceStarterFromRunTracePropagatesError(t *testing.T) {
}
func TestTuiTraceStarterFromRunTraceRespectsCancel(t *testing.T) {
- starter := tuiTraceStarterFromRunTrace(func(ctx context.Context, _ chan<- struct{}) error {
- <-ctx.Done()
- return ctx.Err()
- })
+ starter := tuiTraceStarterFromRunTrace(
+ func(ctx context.Context, _ chan<- struct{}, _ func(*eventLoop)) error {
+ <-ctx.Done()
+ return ctx.Err()
+ },
+ )
ctx, cancel := context.WithCancel(context.Background())
cancel()