MCPcopy Index your code
hub / github.com/ChimeraCoder/gitgo / Test_CatFile

Function Test_CatFile

cat-file_test.go:9–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func Test_CatFile(t *testing.T) {
10 const inputSha = SHA("97eed02ebe122df8fdd853c1215d8775f3d9f1a1")
11 const expected = "commit 190\x00" + `tree 9de6c72106b169990a83ce7090c7cad84b6b506b
12author aditya <dev@chimeracoder.net> 1428075900 -0400
13committer aditya <dev@chimeracoder.net> 1428075900 -0400
14
15First commit. Create .gitignore`
16 result, err := CatFile(inputSha)
17 if err != nil {
18 t.Error(err)
19 return
20 }
21
22 if strings.Trim(result, "\n\r") != strings.Trim(expected, "\n\r") {
23
24 t.Errorf("Expected and result don't match:\n%s \n\n\nresult: \n%s", expected, result)
25 }
26}
27
28func Test_parseObjInitialCommit(t *testing.T) {
29 expected := Commit{

Callers

nothing calls this directly

Calls 2

SHATypeAlias · 0.85
CatFileFunction · 0.85

Tested by

no test coverage detected