Refactored, added comprehensive testing.
All checks were successful
Release / release (push) Successful in 3m17s

This commit is contained in:
Jay
2025-10-26 23:23:43 -04:00
parent ec32b75267
commit 1936f055e2
61 changed files with 4678 additions and 769 deletions

27
input/stdin_test.go Normal file
View File

@@ -0,0 +1,27 @@
package input
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
// Integration test helper - run manually with:
// echo "test" | STDIN_TEST=1 go test ./input/ -run TestDetectStdinIntegration
func TestDetectStdinIntegration(t *testing.T) {
if os.Getenv("STDIN_TEST") != "1" {
t.Skip("Set STDIN_TEST=1 and pipe data to run this test")
}
content, hasStdin := DetectStdin()
t.Logf("hasStdin: %v", hasStdin)
t.Logf("content length: %d", len(content))
t.Logf("content: %q", content)
// When piped: should detect stdin
if hasStdin {
assert.NotEmpty(t, content, "Expected content when stdin detected")
}
}