Permalink
Browse files

wrote test for ogg issue

  • Loading branch information...
1 parent 9b2310c commit 233a16567ef2d0e48d391ccbc43897e0d2c95e11 @leetreveil committed May 1, 2012
Binary file not shown.
@@ -0,0 +1,32 @@
+var mm = require('../lib/index'),
+ fs = require('fs'),
+ testy = require('testy')(),
+ assert = testy.assert;
+
+testy.expected = 13;
+
+var sample = require('path').join(__dirname, 'samples/ogg-multipagemetadata-bug.ogg');
+var stream = fs.createReadStream(sample);
+var parser = new mm(stream);
+
+parser.on('metadata', function(result) {
+ assert.strictEqual(result.title, 'Modestep - To The Stars (Break the Noize & The Autobots Remix)');
+ assert.strictEqual(result.artist[0], 'Break The Noize & The Autobots');
+ assert.strictEqual(result.albumartist[0], 'Modestep');
+ assert.strictEqual(result.album, 'To The Stars');
+ assert.strictEqual(result.year, '2011-01-01');
+ assert.strictEqual(result.track.no, 2);
+ assert.strictEqual(result.track.of, 5);
+ assert.strictEqual(result.disk.no, 1);
+ assert.strictEqual(result.disk.of, 1);
+ assert.strictEqual(result.genre[0], 'Dubstep');
+ assert.strictEqual(result.picture[0].format, 'jpg');
+ assert.strictEqual(result.picture[0].data.length, 207439);
+});
+
+parser.on('done', function(err) {
+ if (err) throw err;
+ stream.destroy();
+ assert.ok(true);
+ testy.finish();
+});

0 comments on commit 233a165

Please sign in to comment.