MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestGetCommitMessage

Function TestGetCommitMessage

cmd/opencodereview/git_test.go:62–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestGetCommitMessage(t *testing.T) {
63 dir := initTestGitRepo(t)
64 msg, err := getCommitMessage(dir, "HEAD")
65 if err != nil {
66 t.Fatalf("unexpected error: %v", err)
67 }
68 if msg != "initial commit" {
69 t.Errorf("msg = %q, want 'initial commit'", msg)
70 }
71}
72
73func TestGetCommitMessage_InvalidCommit(t *testing.T) {
74 dir := initTestGitRepo(t)

Callers

nothing calls this directly

Calls 2

initTestGitRepoFunction · 0.85
getCommitMessageFunction · 0.85

Tested by

no test coverage detected