(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func Test_parseObjInitialCommit(t *testing.T) { |
| 29 | expected := Commit{ |
| 30 | _type: "commit", |
| 31 | Tree: "9de6c72106b169990a83ce7090c7cad84b6b506b", |
| 32 | Parents: nil, |
| 33 | Author: "aditya <dev@chimeracoder.net> 1428075900 -0400", |
| 34 | Committer: "aditya <dev@chimeracoder.net> 1428075900 -0400", |
| 35 | Message: "First commit. Create .gitignore", |
| 36 | size: "190", |
| 37 | } |
| 38 | |
| 39 | const input = "commit 190\x00" + `tree 9de6c72106b169990a83ce7090c7cad84b6b506b |
| 40 | author aditya <dev@chimeracoder.net> 1428075900 -0400 |
| 41 | committer aditya <dev@chimeracoder.net> 1428075900 -0400 |
| 42 | |
| 43 | First commit. Create .gitignore` |
| 44 | result, err := parseObj(input) |
| 45 | if err != nil { |
| 46 | t.Error(err) |
| 47 | return |
| 48 | } |
| 49 | |
| 50 | if !reflect.DeepEqual(expected, result) { |
| 51 | t.Errorf("Expected and result don't match:\n%+v\n%+v", expected, result) |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | func Test_parseObj(t *testing.T) { |
| 56 | const inputSha = SHA("3ead3116d0378089f5ce61086354aac43e736b01") |
nothing calls this directly
no test coverage detected