Skip to content

Commit 8d2d560

Browse files
committed
fixed test for cli
1 parent 29a50ba commit 8d2d560

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

cmd/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.16
55
require (
66
github.com/Code-Hex/Neo-cowsay/v2 v2.0.3
77
github.com/Code-Hex/go-wordwrap v1.0.0
8+
github.com/google/go-cmp v0.5.6
89
github.com/jessevdk/go-flags v1.5.0
910
github.com/ktr0731/go-fuzzyfinder v0.5.1
1011
github.com/mattn/go-colorable v0.1.11

cmd/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
github.com/Code-Hex/Neo-cowsay/v2 v2.0.3 h1:mreJLDHRxoFhUvlw/1pFZIkekYVCg1hdMJ49QdZSASA=
2-
github.com/Code-Hex/Neo-cowsay/v2 v2.0.3/go.mod h1:6k40Pwrc2FazLf1BUbmAC36E9LvT+DErjZr30isbXhg=
31
github.com/Code-Hex/go-wordwrap v1.0.0 h1:yl5fLyZEz3+hPGbpTRlTQ8mQJ1HXWcTq1FCNR1ch6zM=
42
github.com/Code-Hex/go-wordwrap v1.0.0/go.mod h1:/SsbgkY2Q0aPQRyvXcyQwWYTQOIwSORKe6MPjRVGIWU=
53
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=

cmd/internal/cli/cli_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"path/filepath"
88
"strings"
99
"testing"
10+
11+
"github.com/google/go-cmp/cmp"
1012
)
1113

1214
func TestCLI_Run(t *testing.T) {
@@ -132,6 +134,7 @@ func TestCLI_Run(t *testing.T) {
132134
}
133135
want := string(content)
134136
if got := stdout.String(); want != got {
137+
t.Log(cmp.Diff(want, got))
135138
t.Errorf("want\n%s\n-----got\n%s\n", want, got)
136139
}
137140
})

0 commit comments

Comments
 (0)