Add comment metadata (#44)
This commit is contained in:
+17
-12
@@ -39,15 +39,17 @@ var fullMetadata = testMetadata{
|
||||
Track: 3,
|
||||
TrackTotal: 6,
|
||||
Year: 2000,
|
||||
Comment: "Test Comment",
|
||||
}
|
||||
var mp3id3v11Metadata = testMetadata{
|
||||
Album: "Test Album",
|
||||
Artist: "Test Artist",
|
||||
Genre: "Jazz",
|
||||
Lyrics: "",
|
||||
Title: "Test Title",
|
||||
Track: 3,
|
||||
Year: 2000,
|
||||
Album: "Test Album",
|
||||
Artist: "Test Artist",
|
||||
Genre: "Jazz",
|
||||
Lyrics: "",
|
||||
Title: "Test Title",
|
||||
Track: 3,
|
||||
Year: 2000,
|
||||
Comment: "Test Comment",
|
||||
}
|
||||
|
||||
func TestReadFrom(t *testing.T) {
|
||||
@@ -60,11 +62,12 @@ func TestReadFrom(t *testing.T) {
|
||||
"with_tags/sample.m4a": fullMetadata,
|
||||
"with_tags/sample.mp4": fullMetadata,
|
||||
"with_tags/sample.ogg": fullMetadata,
|
||||
"without_tags/sample.flac": emptyMetadata,
|
||||
"without_tags/sample.m4a": emptyMetadata,
|
||||
"without_tags/sample.mp3": emptyMetadata,
|
||||
"without_tags/sample.mp4": emptyMetadata,
|
||||
"without_tags/sample.ogg": emptyMetadata,
|
||||
|
||||
"without_tags/sample.flac": emptyMetadata,
|
||||
"without_tags/sample.m4a": emptyMetadata,
|
||||
"without_tags/sample.mp3": emptyMetadata,
|
||||
"without_tags/sample.mp4": emptyMetadata,
|
||||
"without_tags/sample.ogg": emptyMetadata,
|
||||
}
|
||||
|
||||
for path, metadata := range testdata {
|
||||
@@ -80,6 +83,7 @@ func TestReadFrom(t *testing.T) {
|
||||
}
|
||||
|
||||
func test(t *testing.T, path string, metadata testMetadata) error {
|
||||
t.Log("testing " + path)
|
||||
f, err := os.Open("testdata/" + path)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -103,6 +107,7 @@ func compareMetadata(t *testing.T, m Metadata, tt testMetadata) {
|
||||
testValue(t, tt.Lyrics, m.Lyrics())
|
||||
testValue(t, tt.Title, m.Title())
|
||||
testValue(t, tt.Year, m.Year())
|
||||
testValue(t, tt.Comment, m.Comment())
|
||||
|
||||
disc, discTotal := m.Disc()
|
||||
testValue(t, tt.Disc, disc)
|
||||
|
||||
Reference in New Issue
Block a user