mirror of
https://github.com/octoleo/restic.git
synced 2024-12-29 13:22:43 +00:00
a376323331
Previously, they were printed as freeform text. This also adds a ui.Terminal interface to make writing tests easier and also adds a few tests.
23 lines
398 B
Go
23 lines
398 B
Go
package ui
|
|
|
|
type MockTerminal struct {
|
|
Output []string
|
|
Errors []string
|
|
}
|
|
|
|
func (m *MockTerminal) Print(line string) {
|
|
m.Output = append(m.Output, line)
|
|
}
|
|
|
|
func (m *MockTerminal) Error(line string) {
|
|
m.Errors = append(m.Errors, line)
|
|
}
|
|
|
|
func (m *MockTerminal) SetStatus(lines []string) {
|
|
m.Output = append([]string{}, lines...)
|
|
}
|
|
|
|
func (m *MockTerminal) CanUpdateStatus() bool {
|
|
return true
|
|
}
|