mirror of https://github.com/perkeep/perkeep.git
camput: set os.Args from env.Run.args before test's cmdmain.Main runs
Not required now, but will be for future tests. Change-Id: I50c469d4f4fa589494036f306c25fe60914fb902
This commit is contained in:
parent
16219f24b0
commit
1509f266be
|
@ -19,6 +19,7 @@ package main
|
|||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -37,6 +38,7 @@ type env struct {
|
|||
func (e *env) Run(args ...string) (out, err []byte, exitCode int) {
|
||||
outbuf := new(bytes.Buffer)
|
||||
errbuf := new(bytes.Buffer)
|
||||
os.Args = append(os.Args[:1], args...)
|
||||
cmdmain.Stdout, cmdmain.Stderr = outbuf, errbuf
|
||||
exitc := make(chan int, 1)
|
||||
cmdmain.Exit = func(code int) {
|
||||
|
|
Loading…
Reference in New Issue