From 1896c75041bdcd3e1dfd69adf1003aa850fa3fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20G=C3=BCnzler?= Date: Thu, 11 Oct 2018 15:17:10 +0200 Subject: [PATCH] housekeeping: update go.mod and fix smoke test --- go.mod | 4 +++- porcelain_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 641324d..4cea4eb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/robertgzr/porcelain require ( + github.com/mattn/go-colorable v0.0.9 // indirect + github.com/mattn/go-isatty v0.0.4 // indirect github.com/robertgzr/color v0.0.0-20180506014805-e601f373894f - golang.org/x/sys v0.0.0-20180504064212-6f686a352de6 + golang.org/x/sys v0.0.0-20180504064212-6f686a352de6 // indirect ) diff --git a/porcelain_test.go b/porcelain_test.go index fb2616b..c270a6b 100644 --- a/porcelain_test.go +++ b/porcelain_test.go @@ -5,16 +5,16 @@ import ( "testing" ) -const expectedDebugOutput string = "&main.PorcInfo{branch:\"master\", commit:\"51c9c58e2175b768137c1e38865f394c76a7d49d\", remote:\"\", upstream:\"origin/master\", ahead:1, behind:10, untracked:5, unmerged:1, Unstaged:main.GitArea{modified:3, added:0, deleted:1, renamed:0, copied:0}, Staged:main.GitArea{modified:0, added:0, deleted:0, renamed:1, copied:0}}" +const expectedFmtOutput = ` master@51c9c58  ↑1  ↓10  ?‼Δ ✘` -func TestDebugOutput(t *testing.T) { +func TestFmtOutput(t *testing.T) { var pi = new(PorcInfo) if err := pi.ParsePorcInfo(strings.NewReader(gitoutput)); err != nil { t.Fatal(err) } - if out := pi.Debug(); out != expectedDebugOutput { - t.Logf("\nexpected:\n%s\ngot:\n%s\n", expectedDebugOutput, out) + if out := pi.Fmt(); out != expectedFmtOutput { + t.Logf("\nexpected:\n%s\ngot:\n%s\n", expectedFmtOutput, out) t.FailNow() } }