1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 18:32:34 +01:00

add test for xmeml #839

This commit is contained in:
Mikael Finstad 2021-11-14 22:24:26 +07:00
parent 3db3241ccd
commit 9ea7dcd46e
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
3 changed files with 1549 additions and 2 deletions

View File

@ -0,0 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`parses xmeml 1 1`] = `
Array [
Object {
"end": 8.56,
"start": 0,
},
Object {
"end": 13.12,
"start": 8.56,
},
Object {
"end": 19.12,
"start": 13.12,
},
Object {
"end": 27.96,
"start": 19.12,
},
Object {
"end": 39.08,
"start": 27.96,
},
Object {
"end": 49.36,
"start": 39.08,
},
]
`;

View File

@ -1,7 +1,9 @@
import fs from 'fs';
import { join } from 'path';
import { parseYouTube, formatYouTube, parseMplayerEdl } from './edlFormats';
import { parseYouTube, formatYouTube, parseMplayerEdl, parseXmeml } from './edlFormats';
const readFixture = async (name, encoding = 'utf-8') => fs.promises.readFile(join(__dirname, 'fixtures', name), encoding);
it('parseYoutube', () => {
const str = `
@ -83,7 +85,7 @@ it('parseMplayerEdl', async () => {
`;
*/
const str = await fs.promises.readFile(join(__dirname, 'fixtures', 'mplayer.edl'), 'utf-8');
const str = await readFixture('mplayer.edl');
expect(await parseMplayerEdl(str)).toEqual([
{ start: 0,
@ -129,3 +131,7 @@ it('parseMplayerEdl, starting at 0', async () => {
},
}]);
});
it('parses xmeml 1', async () => {
expect(await parseXmeml(await readFixture('Final Cut Pro XMEML.xml'))).toMatchSnapshot();
});

File diff suppressed because it is too large Load Diff