From 8a6a21811a7bbe1942734052378da71df991fd08 Mon Sep 17 00:00:00 2001 From: Micheal Wilkinson Date: Sat, 21 Mar 2026 11:18:10 +0000 Subject: [PATCH] chore(go): add failing core constructor tests --- internal/homesick/core/core_test.go | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/internal/homesick/core/core_test.go b/internal/homesick/core/core_test.go index 9dcd918..1da9dff 100644 --- a/internal/homesick/core/core_test.go +++ b/internal/homesick/core/core_test.go @@ -1,6 +1,31 @@ package core -import "testing" +import ( + "bytes" + "testing" +) + +func TestNewRejectsNilWriters(t *testing.T) { + t.Run("nil stdout", func(t *testing.T) { + app, err := New(nil, &bytes.Buffer{}) + if err == nil { + t.Fatal("expected error for nil stdout") + } + if app != nil { + t.Fatal("expected nil app for nil stdout") + } + }) + + t.Run("nil stderr", func(t *testing.T) { + app, err := New(&bytes.Buffer{}, nil) + if err == nil { + t.Fatal("expected error for nil stderr") + } + if app != nil { + t.Fatal("expected nil app for nil stderr") + } + }) +} func TestDeriveDestination(t *testing.T) { tests := []struct {