{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmdtest\n\n## Types\n\n```go\ntype TestCmd struct {\n\t// For total convenience, all testing methods are available.\n\t*testing.T\n\n\tFunc    template.FuncMap\n\tData    interface{}\n\tCleanup func()\n\n\t// Err will contain the process exit error or interrupt signal error\n\tErr error\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTestCmd(t *testing.T, data interface{}) *TestCmd\n```\n\n```go\nfunc (tt *TestCmd) CloseStdin()\n```\n\n```go\nfunc (tt *TestCmd) ExitStatus() int\n```\nExitStatus exposes the process' OS exit code It will only return a valid value after the process has finished.\n\n```go\nfunc (tt *TestCmd) Expect(tplsource string)\n```\nExpect runs its argument as a template, then expects the child process to output the result of the template within 5s.\n\nIf the template starts with a newline, the newline is removed before matching.\n\n```go\nfunc (tt *TestCmd) ExpectExit()\n```\nExpectExit expects the child process to exit within 5s without printing any additional text on stdout.\n\n```go\nfunc (tt *TestCmd) ExpectRegexp(regex string) (*regexp.Regexp, []string)\n```\nExpectRegexp expects the child process to output text matching the given regular expression within 5s.\n\nNote that an arbitrary amount of output may be consumed by the regular expression. This usually means that expect cannot be used after ExpectRegexp.\n\n```go\nfunc (tt *TestCmd) InputLine(s string) string\n```\nInputLine writes the given text to the child's stdin. This method can also be called from an expect template, e.g.:\n\n\tgeth.expect(`Passphrase: {{.InputLine \"password\"}}`)\n\n```go\nfunc (tt *TestCmd) Interrupt()\n```\n\n```go\nfunc (tt *TestCmd) Kill()\n```\n\n```go\nfunc (tt *TestCmd) Output() []byte\n```\nOutput reads all output from stdout, and returns the data.\n\n```go\nfunc (tt *TestCmd) Run(name string, args ...string)\n```\nRun exec's the current binary using name as argv\\[0] which will trigger the reexec init function for that name (e.g. \"geth-test\" in cmd/geth/run\\_test.go)\n\n```go\nfunc (tt *TestCmd) SetTemplateFunc(name string, fn interface{})\n```\n\n```go\nfunc (tt *TestCmd) StderrText() string\n```\nStderrText returns any stderr output written so far. The returned text holds all log lines after ExpectExit has returned.\n\n```go\nfunc (tt *TestCmd) WaitExit()\n```\n\n","path":"github.com/Evolution404/simcore/internal/cmdtest","name":"cmdtest","synopsis":"","isRedistributable":true}
