⬥ ID3 encoding/decoding library in Go ⬥
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.

35 lines
745 B

package id3ed
import (
"os"
"testing"
)
func TestGetHeader(t *testing.T) {
f, err := os.Open("./testData/testreadv2.mp3")
if err != nil {
t.Errorf("%s", err)
}
header, err := GetHeader(f)
if err != nil {
t.Errorf("GetHeader failed: %s", err)
}
if header.Identifier != "ID3" {
t.Errorf("GetHeader failed: expected identifier %s; got %s", "ID3", header.Identifier)
}
if header.Compressed != false {
t.Errorf("GetHeader failed: expected flag %v; got %v", false, header.Compressed)
}
if header.Unsynchronisated != false {
t.Errorf("GetHeader failed: expected flag %v; got %v", false, header.Unsynchronisated)
}
if header.Size != 1138 {
t.Errorf("GetHeader failed: expected size %v; got %v", 1138, header.Size)
}
}