@@ -34,9 +34,9 @@ func (w *writeCloseSpy) Close() error {
3434 return nil
3535}
3636
37- // TestGoStageHonorsCloseFlags verifies that a Function stage closes
38- // stdin/stdout iff the corresponding close flag is true .
39- func TestGoStageHonorsCloseFlags (t * testing.T ) {
37+ // TestGoStageHonorsStreamOwnership verifies that a Function stage closes
38+ // stdin/stdout iff the corresponding stream is closing .
39+ func TestGoStageHonorsStreamOwnership (t * testing.T ) {
4040 cases := []struct {
4141 name string
4242 leaveIn , leaveOut bool
@@ -63,8 +63,8 @@ func TestGoStageHonorsCloseFlags(t *testing.T) {
6363 ))
6464 require .NoError (t , s .Wait ())
6565
66- assert .Equal (t , ! tc .leaveIn , in .closed .Load (), "closeStdin =%v" , ! tc .leaveIn )
67- assert .Equal (t , ! tc .leaveOut , out .closed .Load (), "closeStdout =%v" , ! tc .leaveOut )
66+ assert .Equal (t , ! tc .leaveIn , in .closed .Load (), "closing stdin =%v" , ! tc .leaveIn )
67+ assert .Equal (t , ! tc .leaveOut , out .closed .Load (), "closing stdout =%v" , ! tc .leaveOut )
6868 })
6969 }
7070}
@@ -88,8 +88,8 @@ func TestStreamConstructorsPreserveOwnershipAndDynamicType(t *testing.T) {
8888}
8989
9090// TestCommandStageHonorsCloseStdin verifies that a command stage closes a
91- // non-file stdin (a "late" closer) iff closeStdin is true . An empty
92- // reader is used so exec.Cmd's input-copy goroutine sees EOF promptly.
91+ // non-file stdin (a "late" closer) iff the input stream is closing . An
92+ // empty reader is used so exec.Cmd's input-copy goroutine sees EOF promptly.
9393func TestCommandStageHonorsCloseStdin (t * testing.T ) {
9494 for _ , leave := range []bool {false , true } {
9595 name := "owns stdin"
@@ -109,14 +109,14 @@ func TestCommandStageHonorsCloseStdin(t *testing.T) {
109109 ))
110110 require .NoError (t , s .Wait ())
111111
112- assert .Equal (t , ! leave , in .closed .Load (), "closeStdin =%v" , ! leave )
112+ assert .Equal (t , ! leave , in .closed .Load (), "closing stdin =%v" , ! leave )
113113 })
114114 }
115115}
116116
117117// TestCommandStageHonorsCloseStdout verifies the stdout counterpart: a
118118// non-file stdout (routed through the pooled-copy path) is closed iff
119- // closeStdout is true .
119+ // the output stream is closing .
120120func TestCommandStageHonorsCloseStdout (t * testing.T ) {
121121 for _ , leave := range []bool {false , true } {
122122 name := "owns stdout"
@@ -136,7 +136,7 @@ func TestCommandStageHonorsCloseStdout(t *testing.T) {
136136 ))
137137 require .NoError (t , s .Wait ())
138138
139- assert .Equal (t , ! leave , out .closed .Load (), "closeStdout =%v" , ! leave )
139+ assert .Equal (t , ! leave , out .closed .Load (), "closing stdout =%v" , ! leave )
140140 })
141141 }
142142}
0 commit comments