(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func TestPointerScannerWithValidOutput(t *testing.T) { |
| 19 | blobs := []*Pointer{ |
| 20 | &Pointer{ |
| 21 | Version: "https://git-lfs.github.com/spec/v1", |
| 22 | Oid: "e71eefd918ea175b8f362611f981f648dbf9888ff74865077cb4c9077728f350", |
| 23 | Size: 123, |
| 24 | OidType: "sha256", |
| 25 | }, |
| 26 | &Pointer{ |
| 27 | Version: "https://git-lfs.github.com/spec/v1", |
| 28 | Oid: "0eb69b651be65d5a61d6bebf2c53c811a5bf8031951111000e2077f4d7fe43b1", |
| 29 | Size: 132, |
| 30 | OidType: "sha256", |
| 31 | }, |
| 32 | } |
| 33 | |
| 34 | be, _ := gitobj.NewMemoryBackend(nil) |
| 35 | db, _ := gitobj.FromBackend(be) |
| 36 | shas := fakeObjectsWithRandoData(t, db, blobs) |
| 37 | |
| 38 | scanner := &PointerScanner{ |
| 39 | scanner: git.NewObjectScannerFrom(db), |
| 40 | } |
| 41 | iter := 0 |
| 42 | |
| 43 | for i := 0; i < 5; i++ { |
| 44 | assertNextEmptyPointer(t, scanner, shas[iter]) |
| 45 | iter++ |
| 46 | } |
| 47 | |
| 48 | assertNextPointer(t, scanner, shas[iter], "e71eefd918ea175b8f362611f981f648dbf9888ff74865077cb4c9077728f350") |
| 49 | iter++ |
| 50 | |
| 51 | for i := 0; i < 5; i++ { |
| 52 | assertNextEmptyPointer(t, scanner, shas[iter]) |
| 53 | iter++ |
| 54 | } |
| 55 | |
| 56 | assertNextPointer(t, scanner, shas[iter], "0eb69b651be65d5a61d6bebf2c53c811a5bf8031951111000e2077f4d7fe43b1") |
| 57 | iter++ |
| 58 | |
| 59 | for i := 0; i < 5; i++ { |
| 60 | assertNextEmptyPointer(t, scanner, shas[iter]) |
| 61 | iter++ |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func TestPointerScannerWithLargeBlobs(t *testing.T) { |
| 66 | buf := bytes.NewBuffer(make([]byte, 0, 1025)) |
nothing calls this directly
no test coverage detected