(t *testing.T)
| 46 | } |
| 47 | |
| 48 | func TestFileReader_Read_LargeBuff(t *testing.T) { |
| 49 | bFile, err := bfs.OpenBlocksFile("testdata/test.b", bfs.DefaultBlockFileOptions) |
| 50 | if err != nil { |
| 51 | if os.IsNotExist(err) { |
| 52 | t.Log(err) |
| 53 | return |
| 54 | } |
| 55 | t.Fatal(err) |
| 56 | } |
| 57 | |
| 58 | reader, err := bFile.OpenFileReader(bfs.Hash("123456"), false) |
| 59 | if err != nil { |
| 60 | if os.IsNotExist(err) { |
| 61 | t.Log(err) |
| 62 | return |
| 63 | } |
| 64 | t.Fatal(err) |
| 65 | } |
| 66 | |
| 67 | defer func() { |
| 68 | _ = reader.Close() |
| 69 | }() |
| 70 | |
| 71 | var buf = make([]byte, 128) |
| 72 | for { |
| 73 | n, readErr := reader.Read(buf) |
| 74 | if n > 0 { |
| 75 | t.Log(string(buf[:n])) |
| 76 | } |
| 77 | if readErr != nil { |
| 78 | if readErr == io.EOF { |
| 79 | break |
| 80 | } |
| 81 | t.Fatal(readErr) |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | func TestFileReader_Read_LargeFile(t *testing.T) { |
| 87 | bFile, err := bfs.OpenBlocksFile("testdata/test.b", bfs.DefaultBlockFileOptions) |
nothing calls this directly
no test coverage detected