(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func TestPackNormal(t *testing.T) { |
| 156 | const fileSize = 5 << 20 |
| 157 | const fileName = "foo.dat" |
| 158 | fileContents := randBytes(fileSize) |
| 159 | |
| 160 | hash := blob.NewHash() |
| 161 | hash.Write(fileContents) |
| 162 | wholeRef := blob.RefFromHash(hash) |
| 163 | |
| 164 | pt := testPack(t, |
| 165 | func(sto blobserver.Storage) error { |
| 166 | _, err := schema.WriteFileFromReader(ctxbg, sto, fileName, bytes.NewReader(fileContents)) |
| 167 | return err |
| 168 | }, |
| 169 | wantNumLargeBlobs(1), |
| 170 | wantNumSmallBlobs(0), |
| 171 | ) |
| 172 | // And verify we can read it back out. |
| 173 | pt.testOpenWholeRef(t, wholeRef, fileSize) |
| 174 | } |
| 175 | |
| 176 | func TestPackNoDelete(t *testing.T) { |
| 177 | const fileSize = 1 << 20 |
nothing calls this directly
no test coverage detected