summaryrefslogtreecommitdiff
path: root/internal/tui/tui_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-13 10:32:36 +0300
committerPaul Buetow <paul@buetow.org>2026-05-13 10:32:36 +0300
commit75fd7c03b1a8018f85e2da779ab59b86ad0efb58 (patch)
treea3b155ad9abb66a820d31e839aa023c1d45c3516 /internal/tui/tui_test.go
parent6d407096405520d5e157235e52773b9a4f3e4396 (diff)
fix: move context.Context to first parameter in startTraceCmd and startTraceCmdWithTimeout
Per Go convention, context.Context must always be the first parameter. Updated both function signatures and all call sites in tracelifecycle.go and tui_test.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/tui/tui_test.go')
-rw-r--r--internal/tui/tui_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go
index a685719..5f007e4 100644
--- a/internal/tui/tui_test.go
+++ b/internal/tui/tui_test.go
@@ -202,7 +202,7 @@ func TestQuitKeyMatchesSingleBindingWithoutPanic(t *testing.T) {
}
func TestStartTraceCmdLaunchesBeforeStarterReturns(t *testing.T) {
- cmd := startTraceCmd(func(context.Context) error { return nil }, context.Background())
+ cmd := startTraceCmd(context.Background(), func(context.Context) error { return nil })
msg := cmd()
if _, ok := msg.(TracingStartedMsg); !ok {
t.Fatalf("expected TracingStartedMsg, got %T", msg)
@@ -210,7 +210,7 @@ func TestStartTraceCmdLaunchesBeforeStarterReturns(t *testing.T) {
}
func TestStartTraceCmdEmitsErrorMsg(t *testing.T) {
- cmd := startTraceCmd(func(context.Context) error { return errors.New("trace failed") }, context.Background())
+ cmd := startTraceCmd(context.Background(), func(context.Context) error { return errors.New("trace failed") })
msg := cmd()
traceErr, ok := msg.(TracingErrorMsg)
if !ok {
@@ -235,7 +235,7 @@ func TestStartTraceCmdTimeoutEmitsErrorMsg(t *testing.T) {
}
// Use a short timeout so the test finishes quickly.
- cmd := startTraceCmdWithTimeout(blocker, ctx, 50*time.Millisecond)
+ cmd := startTraceCmdWithTimeout(ctx, blocker, 50*time.Millisecond)
msg := cmd()
traceErr, ok := msg.(TracingErrorMsg)
@@ -265,7 +265,7 @@ func TestStartTraceCmdContextCancelledBeforeTimeoutReturnsNil(t *testing.T) {
// Cancel ctx immediately so the starter exits before the timeout.
cancel()
- cmd := startTraceCmdWithTimeout(blocker, ctx, 5*time.Second)
+ cmd := startTraceCmdWithTimeout(ctx, blocker, 5*time.Second)
msg := cmd()
if msg != nil {