aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/git/git_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/git/git_test.go')
-rw-r--r--pkg/git/git_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkg/git/git_test.go b/pkg/git/git_test.go
new file mode 100644
index 000000000..42d2d3a07
--- /dev/null
+++ b/pkg/git/git_test.go
@@ -0,0 +1,23 @@
+// Copyright 2017 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+package git
+
+import (
+ "testing"
+)
+
+func TestCanonicalizeCommit(t *testing.T) {
+ tests := map[string]string{
+ "foo bar": "foo bar",
+ " foo ": "foo",
+ "UPSTREAM: foo bar": "foo bar",
+ "BACKPORT: UPSTREAM: foo bar": "UPSTREAM: foo bar",
+ }
+ for in, want := range tests {
+ got := CanonicalizeCommit(in)
+ if got != want {
+ t.Errorf("input %q: got %q, want %q", in, got, want)
+ }
+ }
+}