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

Function initRulesCheckTestRepo

cmd/opencodereview/rules_cmd_test.go:14–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func initRulesCheckTestRepo(t *testing.T) string {
15 t.Helper()
16 repo := t.TempDir()
17 git := func(args ...string) {
18 t.Helper()
19 cmd := exec.Command("git", args...)
20 cmd.Dir = repo
21 if out, err := cmd.CombinedOutput(); err != nil {
22 t.Fatalf("git %v: %v\n%s", args, err, out)
23 }
24 }
25 git("init")
26 git("config", "user.email", "t@t.co")
27 git("config", "user.name", "t")
28 return repo
29}
30
31func writeRulesCheckTestFile(t *testing.T, repo, relPath, content string) {
32 t.Helper()

Calls

no outgoing calls

Tested by

no test coverage detected