f3e5d4af by Lee Whitaker

Add test for stripping carriage returns.

1 parent afb634ee
...@@ -206,6 +206,23 @@ ...@@ -206,6 +206,23 @@
206 manifest.substring(manifest.indexOf(',') + 1, manifest.length - 1), 206 manifest.substring(manifest.indexOf(',') + 1, manifest.length - 1),
207 'the title is parsed'); 207 'the title is parsed');
208 }); 208 });
209 test('parses #EXTINF tags with carriage returns', function() {
210 var
211 manifest = '#EXTINF:13,Does anyone really use the title attribute?\r\n',
212 element;
213 parseStream.on('data', function(elem) {
214 element = elem;
215 });
216 lineStream.push(manifest);
217
218 ok(element, 'an event was triggered');
219 strictEqual(element.type, 'tag', 'the line type is tag');
220 strictEqual(element.tagType, 'inf', 'the tag type is inf');
221 strictEqual(element.duration, 13, 'the duration is parsed');
222 strictEqual(element.title,
223 manifest.substring(manifest.indexOf(',') + 1, manifest.length - 2),
224 'the title is parsed');
225 });
209 226
210 // #EXT-X-TARGETDURATION 227 // #EXT-X-TARGETDURATION
211 test('parses minimal #EXT-X-TARGETDURATION tags', function() { 228 test('parses minimal #EXT-X-TARGETDURATION tags', function() {
......