aboutsummaryrefslogtreecommitdiffstats
path: root/commands/execenv/env_testing.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2023-01-10 21:36:03 +0100
committerMichael Muré <batolettre@gmail.com>2023-01-11 14:31:22 +0100
commit7df34aa7a40be0d7b759ea3ef42cedf9f25f32b2 (patch)
treea3d1cc77f56814d4ec8838f18cb6768035c1b290 /commands/execenv/env_testing.go
parent9c50a359704f4edd2f33df6d256e032feae3a576 (diff)
downloadgit-bug-7df34aa7a40be0d7b759ea3ef42cedf9f25f32b2.tar.gz
commands: add a nice terminal progress bar when building the cache
One issue remaining is that writing the cache takes significant time, but I don't know how to reflect that nicely to the user.
Diffstat (limited to 'commands/execenv/env_testing.go')
-rw-r--r--commands/execenv/env_testing.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/commands/execenv/env_testing.go b/commands/execenv/env_testing.go
index 34eafc9c..6eb9c69d 100644
--- a/commands/execenv/env_testing.go
+++ b/commands/execenv/env_testing.go
@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
+ "io"
"testing"
"github.com/stretchr/testify/require"
@@ -12,6 +13,8 @@ import (
"github.com/MichaelMure/git-bug/repository"
)
+var _ Out = &TestOut{}
+
type TestOut struct {
*bytes.Buffer
}
@@ -37,6 +40,10 @@ func (te *TestOut) PrintJSON(v interface{}) error {
return nil
}
+func (te *TestOut) Raw() io.Writer {
+ return te.Buffer
+}
+
func NewTestEnv(t *testing.T) *Env {
t.Helper()