NewTestUI will return a UI object where Out, In, and Err are customizable, and colors are disabled
(in io.Reader, out io.Writer, err io.Writer)
| 154 | // NewTestUI will return a UI object where Out, In, and Err are customizable, |
| 155 | // and colors are disabled |
| 156 | func NewTestUI(in io.Reader, out io.Writer, err io.Writer) *UI { |
| 157 | translationFunc, translateErr := generateTranslationFunc([]byte("[]")) |
| 158 | if translateErr != nil { |
| 159 | panic(translateErr) |
| 160 | } |
| 161 | |
| 162 | return &UI{ |
| 163 | In: in, |
| 164 | Out: out, |
| 165 | OutForInteraction: out, |
| 166 | Err: err, |
| 167 | Exiter: realExiter, |
| 168 | colorEnabled: configv3.ColorDisabled, |
| 169 | translate: translationFunc, |
| 170 | Interactor: realInteract, |
| 171 | terminalLock: &sync.Mutex{}, |
| 172 | fileLock: &sync.Mutex{}, |
| 173 | TimezoneLocation: time.UTC, |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | // DeferText translates the template, substitutes in templateValues, and |
| 178 | // Enqueues the output to be presented later via FlushDeferred. Only the first |
no test coverage detected