File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -363,9 +363,7 @@ func (ts *TestScript) cmdStdin(neg bool, args []string) {
363363 if len (args ) != 1 {
364364 ts .Fatalf ("usage: stdin filename" )
365365 }
366- data , err := ioutil .ReadFile (ts .MkAbs (args [0 ]))
367- ts .Check (err )
368- ts .stdin = string (data )
366+ ts .stdin = ts .ReadFile (args [0 ])
369367}
370368
371369// stdout checks that the last go command standard output matches a regexp.
Original file line number Diff line number Diff line change @@ -180,6 +180,8 @@ The predefined commands are:
180180
181181- stdin file
182182 Set the standard input for the next exec command to the contents of the given file.
183+ File can be "stdout" or "stderr" to use the standard output or standard error
184+ from the most recent exec or wait command.
183185
184186- [!] stderr [-count=N] pattern
185187 Apply the grep command (see above) to the standard error
Original file line number Diff line number Diff line change @@ -4,6 +4,15 @@ stdout hello
44[exec:cat] exec cat
55! stdout hello
66
7+
8+ [!exec:cat] stop
9+
10+ # Check that 'stdin stdout' works.
11+ exec cat hello.txt
12+ stdin stdout
13+ exec cat
14+ stdout hello
15+
716-- hello.txt --
817hello
918
You can’t perform that action at this time.
0 commit comments