Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
model, err := p.eventLoop(model, cmds)
killed := p.ctx.Err() != nil || err != nil
if killed && err == nil {
err = fmt.Errorf("%w: %s", ErrProgramKilled, p.ctx.Err())
err = fmt.Errorf("%w: %w", ErrProgramKilled, p.ctx.Err())

Check failure on line 625 in tea.go

View workflow job for this annotation

GitHub Actions / build-go-mod / build (ubuntu-latest)

fmt.Errorf call has more than one error-wrapping directive %w

Check failure on line 625 in tea.go

View workflow job for this annotation

GitHub Actions / build-go-mod / build (ubuntu-latest)

fmt.Errorf call has more than one error-wrapping directive %w
}
if err == nil {
// Ensure we rendered the final state of the model.
Expand Down
4 changes: 4 additions & 0 deletions tea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ func TestTeaKill(t *testing.T) {
if _, err := p.Run(); !errors.Is(err, ErrProgramKilled) {
t.Fatalf("Expected %v, got %v", ErrProgramKilled, err)
}

if _, err := p.Run(); !errors.Is(err, context.Canceled) {
t.Fatalf("Expected %v, got %v", context.Canceled, err)
}
}

func TestTeaContext(t *testing.T) {
Expand Down
Loading