Browse Source

Fixed README and a test

main
Unbewohnte 3 years ago
parent
commit
60047a2902
  1. 9
      README.md
  2. 11
      v2/read_test.go

9
README.md

@ -120,9 +120,12 @@ func main() {
}
if mp3tag.Header.Version == id3v2.V2_3 {
// get certain frame by identifier
title := mp3tag.Frames["TIT2"]
artist := mp3tag.Frames["TPE1"]
// get certain frame by identifier.
// Contents is []byte. CAN AND PROBABLY WILL
// CONTAIN NULL OR OTHER NON-PRINTABLE BYTES !!!
// Text encoding support is still not implemented.
title := mp3tag.Frames["TIT2"].Contents
artist := mp3tag.Frames["TPE1"].Contents
}

11
v2/read_test.go

@ -4,6 +4,8 @@ import (
"os"
"path/filepath"
"testing"
"github.com/Unbewohnte/id3ed/util"
)
func TestReadV2Tag(t *testing.T) {
@ -12,8 +14,15 @@ func TestReadV2Tag(t *testing.T) {
t.Errorf("%s", err)
}
_, err = ReadV2Tag(f)
tag, err := ReadV2Tag(f)
if err != nil {
t.Errorf("GetV2Tag failed: %s", err)
}
titleFrame := tag.Frames["TIT2"]
if util.ToStringLossy(titleFrame.Contents) != "title" {
t.Errorf("ReadV2Tag failed: expected contents to be %s; got %s",
"title", util.ToStringLossy(titleFrame.Contents))
}
}

Loading…
Cancel
Save