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

Function TestGetCommitMessage

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

initTestGitRepoFunction · 0.85
getCommitMessageFunction · 0.85

Tested by

no test coverage detected