aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/sync_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-01-07 12:26:06 -0500
committerRuss Cox <rsc@golang.org>2021-01-07 18:26:42 +0000
commit3f3690dc9cf1f7c0ddca72d1c5313be4022ece58 (patch)
treef302f9307c7019340957396f040613f2962e6417 /git-codereview/sync_test.go
parent541f6aec3b30c1bd064ea95cdaaf57f4e65bef4d (diff)
downloadgo-x-review-3f3690dc9cf1f7c0ddca72d1c5313be4022ece58.tar.xz
git-codereview: add a few more tests
Change-Id: I17ad065e8b4c1eb00cdd2f17af82be76bae4fc09 Reviewed-on: https://go-review.googlesource.com/c/review/+/279717 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'git-codereview/sync_test.go')
-rw-r--r--git-codereview/sync_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/git-codereview/sync_test.go b/git-codereview/sync_test.go
index a4210ab..72cbdf8 100644
--- a/git-codereview/sync_test.go
+++ b/git-codereview/sync_test.go
@@ -104,4 +104,22 @@ func TestSyncRebase(t *testing.T) {
if len(b.Pending()) != 0 {
t.Fatalf("have %d pending CLs after final sync, want 0", len(b.Pending()))
}
+
+ // sync -v prints git output.
+ // also exercising -v parsing.
+ testMain(t, "sync", "-v=true")
+ testNoStdout(t)
+ testPrintedStderr(t, "git pull -q -r origin main")
+
+ testMain(t, "sync", "-v=1")
+ testNoStdout(t)
+ testPrintedStderr(t, "git pull -q -r origin main")
+
+ testMain(t, "sync", "-v")
+ testNoStdout(t)
+ testPrintedStderr(t, "git pull -q -r origin main")
+
+ testMain(t, "sync", "-v=false")
+ testNoStdout(t)
+ testNoStderr(t)
}