openFile opens fn, a file within the testdata dir, and returns an FD and the file's size.
(fn string)
| 26 | |
| 27 | // openFile opens fn, a file within the testdata dir, and returns an FD and the file's size. |
| 28 | func openFile(fn string) (*os.File, int64, error) { |
| 29 | f, err := os.Open(filepath.Join("testdata", fn)) |
| 30 | if err != nil { |
| 31 | return nil, 0, err |
| 32 | } |
| 33 | s, err := f.Stat() |
| 34 | if err != nil { |
| 35 | f.Close() |
| 36 | return nil, 0, err |
| 37 | } |
| 38 | return f, s.Size(), nil |
| 39 | } |
| 40 | |
| 41 | func TestHasID3v1Tag(t *testing.T) { |
| 42 | tests := []struct { |
no test coverage detected