Skip to content

Commit

Permalink
Add explanatory comment to mp3 decoder test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKremer committed Nov 4, 2023
1 parent 84dd3d8 commit 95ab036
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mp3/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import (
)

func TestDecoder_ReturnBehaviour(t *testing.T) {
f, err := os.Open(testtools.TestFilePath("valid_44100hz_22050_samples.mp3"))
f, err := os.Open(testtools.TestFilePath("valid_44100hz_x_padded_samples.mp3"))
assert.NoError(t, err)
defer f.Close()

s, _, err := mp3.Decode(f)
assert.NoError(t, err)
//assert.Equal(t, 22050, s.Len()) // todo: mp3 seems to return more samples than there are in the file. Uncomment this when fixed.
// The length of the streamer isn't tested because mp3 files have
// a different padding depending on the decoder used.
// https://superuser.com/a/1393775

testtools.AssertStreamerHasCorrectReturnBehaviour(t, s, s.Len())
}

0 comments on commit 95ab036

Please sign in to comment.