You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1019 B
48 lines
1019 B
package id3ed |
|
|
|
import ( |
|
"os" |
|
"path/filepath" |
|
"testing" |
|
) |
|
|
|
var TESTDATAPATH string = filepath.Join("testData") |
|
|
|
func TestReadTags(t *testing.T) { |
|
f, err := os.OpenFile(filepath.Join(TESTDATAPATH, "testreadv1.mp3"), os.O_RDONLY, os.ModePerm) |
|
if err != nil { |
|
t.Errorf("%s", err) |
|
} |
|
|
|
_, err = ReadTags(f, 11) |
|
if err != nil { |
|
t.Errorf("ReadTags failed: %s", err) |
|
} |
|
|
|
_, err = ReadTags(f, 10) |
|
if err != nil { |
|
t.Errorf("ReadTags failed: %s", err) |
|
} |
|
} |
|
|
|
// func TestWriteTags(t *testing.T) { |
|
// f, err := os.OpenFile(filepath.Join(TESTDATAPATH, "testreadv1.mp3"), os.O_RDONLY, os.ModePerm) |
|
// if err != nil { |
|
// t.Errorf("%s", err) |
|
// } |
|
|
|
// tagger, err := ReadTags(f, 11) |
|
// if err != nil { |
|
// t.Errorf("%s", err) |
|
// } |
|
|
|
// f2, err := os.OpenFile(filepath.Join(TESTDATAPATH, "testWriteTags.mp3"), os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm) |
|
// if err != nil { |
|
// t.Errorf("%s", err) |
|
// } |
|
|
|
// err = WriteTags(f2, tagger) |
|
// if err != nil { |
|
// t.Errorf("WriteTags failed: %s", err) |
|
// } |
|
// }
|
|
|