(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestOdbHash(t *testing.T) { |
| 95 | t.Parallel() |
| 96 | repo := createTestRepo(t) |
| 97 | defer cleanupTestRepo(t, repo) |
| 98 | |
| 99 | _, _ = seedTestRepo(t, repo) |
| 100 | |
| 101 | odb, err := repo.Odb() |
| 102 | checkFatal(t, err) |
| 103 | |
| 104 | str := `tree 115fcae49287c82eb55bb275cbbd4556fbed72b7 |
| 105 | parent 66e1c476199ebcd3e304659992233132c5a52c6c |
| 106 | author John Doe <john@doe.com> 1390682018 +0000 |
| 107 | committer John Doe <john@doe.com> 1390682018 +0000 |
| 108 | |
| 109 | Initial commit.` |
| 110 | |
| 111 | for _, data := range [][]byte{[]byte(str), doublePointerBytes()} { |
| 112 | oid, err := odb.Hash(data, ObjectCommit) |
| 113 | checkFatal(t, err) |
| 114 | |
| 115 | coid, err := odb.Write(data, ObjectCommit) |
| 116 | checkFatal(t, err) |
| 117 | |
| 118 | if oid.Cmp(coid) != 0 { |
| 119 | t.Fatal("Hash and write Oids are different") |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | func TestOdbForeach(t *testing.T) { |
| 125 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…