Skip to content

Commit

Permalink
Add unit test handling ID32.2 tag ID's in ID32.3 header
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Apr 18, 2021
1 parent 5df2119 commit dfe8e0e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Binary file added test/samples/mp3/issue-795.mp3
Binary file not shown.
21 changes: 21 additions & 0 deletions test/test-id3v2.3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,27 @@ describe('Extract metadata from ID3v2.3 header', () => {

});

it('Handle ID32.2 tag ID\'s in ID32.3 header', async () => {
const filePath = path.join(samplePath, 'mp3', 'issue-795.mp3');

const {native, quality, common} = await mm.parseFile(filePath);
assert.isDefined(native['ID3v2.3'], 'native[\'ID3v2.3\']');
const ids = native['ID3v2.3'].map(tag => {
return tag.id;
});
assert.deepStrictEqual(ids, ['TP1\u0000', 'TP2\u0000', 'TAL\u0000', 'TEN\u0000', 'TIT2'], 'Decode id3v2.3 TAG names');

assert.includeDeepMembers(quality.warnings, [
{message: 'Invalid ID3v2.3 frame-header-ID: TP1\u0000'},
{message: 'Invalid ID3v2.3 frame-header-ID: TP2\u0000'},
{message: 'Invalid ID3v2.3 frame-header-ID: TAL\u0000'},
{message: 'Invalid ID3v2.3 frame-header-ID: TEN\u0000'}
], 'Warning invalid ID: TP1\u0000, TP2\u0000, TAL\u0000 & TEN\u0000');

assert.strictEqual(common.title, 'FDP (Clean Edit)', 'common.title');
});


});

});

0 comments on commit dfe8e0e

Please sign in to comment.