-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(export-csv): parse all variables from filename and include in csv
Signed-off-by: Gustav Grusell <[email protected]>
- Loading branch information
Showing
4 changed files
with
97 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { parseVmafFilename } from './pairVmaf'; | ||
|
||
describe('parseFilename', () => { | ||
it('basename only, should return resolution and bitrate', () => { | ||
expect(parseVmafFilename('1920x1080_0.mp4')) | ||
.toEqual({width: 1920, height: 1080, bitrate: 0, variables: {}}); | ||
}); | ||
|
||
it('full path, should return resolution and bitrate', () => { | ||
expect(parseVmafFilename('/apa/bepa/1920x1080_0.mp4')) | ||
.toEqual({width: 1920, height: 1080, bitrate: 0, variables: {}}); | ||
}); | ||
|
||
it('with variables, should return resolution, bitrate, and variables', () => { | ||
expect(parseVmafFilename('1920x1080_0_VAR1_value1_VAR2_value2_vmaf.json')) | ||
.toEqual({width: 1920, height: 1080, bitrate: 0, variables: { | ||
VAR1: 'value1', | ||
VAR2: 'value2' | ||
}}); | ||
}); | ||
|
||
it('with variables and generic file extension, should return resolution, bitrate, and variables', () => { | ||
expect(parseVmafFilename('1920x1080_0_VAR1_value1_VAR2_value2.mp4')) | ||
.toEqual({width: 1920, height: 1080, bitrate: 0, variables: { | ||
VAR1: 'value1', | ||
VAR2: 'value2' | ||
}}); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters