chore(go): add failing core constructor tests
This commit is contained in:
@@ -1,6 +1,31 @@
|
|||||||
package core
|
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) {
|
func TestDeriveDestination(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user