diff --git a/cmdext/cmdrunner_test.go b/cmdext/cmdrunner_test.go index 9e2d9b8..ac65670 100644 --- a/cmdext/cmdrunner_test.go +++ b/cmdext/cmdrunner_test.go @@ -224,3 +224,22 @@ func TestListener(t *testing.T) { panic(err) } } + +func TestLongStdout(t *testing.T) { + + res1, err := Runner("python"). + Arg("-c"). + Arg("import sys; import time; print(\"1234\" * 10000 + \"\\n\"); print(\"1234\" * 10000 + \"\\n\"); print(\"1234\" * 10000 + \"\\n\");"). + Timeout(100 * time.Millisecond). + Run() + if err != nil { + t.Errorf("%v", err) + } + if res1.StdErr != "" { + t.Errorf("res1.StdErr == '%v'", res1.StdErr) + } + if len(res1.StdOut) != 120006 { + t.Errorf("len(res1.StdOut) == '%v'", len(res1.StdOut)) + } + +}